From 6b9d825af5418759fba6cf5e9b7186398e8d589f Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Mon, 11 Mar 2024 15:02:11 +0000 Subject: [PATCH] chore(main): release 3.10.0 (#737) Co-authored-by: JakeChampion --- CHANGELOG.md | 12 + .../docs/fastly:device/Device/lookup.mdx | 22 ++ .../fastly:device/Device/prototype/brand.mdx | 16 ++ .../Device/prototype/hardwareType.mdx | 18 ++ .../Device/prototype/isDesktop.mdx | 15 ++ .../Device/prototype/isGameConsole.mdx | 15 ++ .../Device/prototype/isMediaPlayer.mdx | 15 ++ .../Device/prototype/isMobile.mdx | 15 ++ .../Device/prototype/isSmartTV.mdx | 15 ++ .../Device/prototype/isTablet.mdx | 15 ++ .../Device/prototype/isTouchscreen.mdx | 15 ++ .../fastly:device/Device/prototype/model.mdx | 15 ++ .../fastly:device/Device/prototype/name.mdx | 15 ++ .../fastly:device/Device/prototype/toJSON.mdx | 24 ++ .../fastly:backend/Backend/Backend.mdx | 219 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../ConfigStore/ConfigStore.mdx | 97 -------- .../ConfigStore/prototype/get.mdx | 98 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 102 -------- .../version-1.0.0/fastly:env/env.mdx | 100 -------- .../allowDynamicBackends.mdx | 93 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../getGeolocationForIpAddress.mdx | 182 -------------- .../fastly:logger/Logger/Logger.mdx | 90 ------- .../fastly:logger/Logger/prototype/log.mdx | 91 ------- .../ObjectStore/ObjectStore.mdx | 62 ----- .../ObjectStore/prototype/get.mdx | 68 ------ .../ObjectStore/prototype/put.mdx | 68 ------ .../Array/prototype/toLocaleString.mdx | 42 ---- .../version-1.0.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-1.0.0/globals/BigInt/asUintN.mdx | 45 ---- .../version-1.0.0/globals/Math/imul.mdx | 35 --- .../version-1.0.0/globals/Proxy/revocable.mdx | 41 ---- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../version-1.0.0/globals/Request/Request.mdx | 45 ---- .../globals/Response/Response.mdx | 47 ---- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/Symbol/toPrimitive.mdx | 21 -- .../version-1.0.0/globals/fetch.mdx | 63 ----- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../ObjectStore/ObjectStore.mdx | 62 ----- .../ObjectStore/prototype/get.mdx | 68 ------ .../ObjectStore/prototype/put.mdx | 68 ------ .../AggregrateError/AggregrateError.mdx | 35 --- .../version-1.1.0/globals/Array/@@species.mdx | 57 ----- .../version-1.1.0/globals/Array/Array.mdx | 41 ---- .../version-1.1.0/globals/Array/from.mdx | 62 ----- .../version-1.1.0/globals/Array/isArray.mdx | 32 --- .../version-1.1.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-1.1.0/globals/BigInt/BigInt.mdx | 37 --- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-1.1.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-1.1.0/globals/Date/Date.mdx | 88 ------- .../version-1.1.0/globals/Date/UTC.mdx | 84 ------- .../version-1.1.0/globals/Date/now.mdx | 19 -- .../version-1.1.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-1.1.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-1.1.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-1.1.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-1.1.0/globals/JSON/parse.mdx | 50 ---- .../version-1.1.0/globals/JSON/stringify.mdx | 96 -------- .../version-1.1.0/globals/Map/@@species.mdx | 25 -- .../version-1.1.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-1.1.0/globals/Math/E.mdx | 17 -- .../version-1.1.0/globals/Math/LN10.mdx | 17 -- .../version-1.1.0/globals/Math/LN2.mdx | 17 -- .../version-1.1.0/globals/Math/LOG10e.mdx | 17 -- .../version-1.1.0/globals/Math/LOG2e.mdx | 17 -- .../version-1.1.0/globals/Math/PI.mdx | 17 -- .../version-1.1.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-1.1.0/globals/Math/SQRT2.mdx | 19 -- .../version-1.1.0/globals/Math/abs.mdx | 29 --- .../version-1.1.0/globals/Math/acos.mdx | 28 --- .../version-1.1.0/globals/Math/acosh.mdx | 28 --- .../version-1.1.0/globals/Math/asin.mdx | 28 --- .../version-1.1.0/globals/Math/asinh.mdx | 28 --- .../version-1.1.0/globals/Math/atan.mdx | 28 --- .../version-1.1.0/globals/Math/atan2.mdx | 51 ---- .../version-1.1.0/globals/Math/atanh.mdx | 29 --- .../version-1.1.0/globals/Math/cbrt.mdx | 28 --- .../version-1.1.0/globals/Math/ceil.mdx | 28 --- .../version-1.1.0/globals/Math/clz32.mdx | 34 --- .../version-1.1.0/globals/Math/cos.mdx | 28 --- .../version-1.1.0/globals/Math/cosh.mdx | 28 --- .../version-1.1.0/globals/Math/exp.mdx | 30 --- .../version-1.1.0/globals/Math/expm1.mdx | 32 --- .../version-1.1.0/globals/Math/floor.mdx | 28 --- .../version-1.1.0/globals/Math/fround.mdx | 32 --- .../version-1.1.0/globals/Math/hypot.mdx | 39 --- .../version-1.1.0/globals/Math/log.mdx | 32 --- .../version-1.1.0/globals/Math/log10.mdx | 30 --- .../version-1.1.0/globals/Math/log1p.mdx | 34 --- .../version-1.1.0/globals/Math/log2.mdx | 30 --- .../version-1.1.0/globals/Math/max.mdx | 33 --- .../version-1.1.0/globals/Math/min.mdx | 33 --- .../version-1.1.0/globals/Math/pow.mdx | 39 --- .../version-1.1.0/globals/Math/random.mdx | 21 -- .../version-1.1.0/globals/Math/round.mdx | 34 --- .../version-1.1.0/globals/Math/sign.mdx | 34 --- .../version-1.1.0/globals/Math/sin.mdx | 28 --- .../version-1.1.0/globals/Math/sinh.mdx | 29 --- .../version-1.1.0/globals/Math/sqrt.mdx | 29 --- .../version-1.1.0/globals/Math/tan.mdx | 31 --- .../version-1.1.0/globals/Math/tanh.mdx | 28 --- .../version-1.1.0/globals/Math/trunc.mdx | 30 --- .../version-1.1.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-1.1.0/globals/Number/NaN.mdx | 17 -- .../version-1.1.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-1.1.0/globals/Number/epsilon.mdx | 21 -- .../version-1.1.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-1.1.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-1.1.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-1.1.0/globals/Object/Object.mdx | 27 --- .../version-1.1.0/globals/Object/assign.mdx | 57 ----- .../version-1.1.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-1.1.0/globals/Object/entries.mdx | 30 --- .../version-1.1.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-1.1.0/globals/Object/hasOwn.mdx | 46 ---- .../version-1.1.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-1.1.0/globals/Object/isFrozen.mdx | 31 --- .../version-1.1.0/globals/Object/isSealed.mdx | 32 --- .../version-1.1.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-1.1.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-1.1.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-1.1.0/globals/Promise/Promise.mdx | 140 ----------- .../version-1.1.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-1.1.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-1.1.0/globals/Promise/race.mdx | 30 --- .../version-1.1.0/globals/Promise/reject.mdx | 32 --- .../version-1.1.0/globals/Promise/resolve.mdx | 39 --- .../version-1.1.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-1.1.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-1.1.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-1.1.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../globals/RangeError/RangeError.mdx | 38 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-1.1.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-1.1.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-1.1.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-1.1.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-1.1.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-1.1.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../version-1.1.0/globals/Set/@@species.mdx | 25 -- .../version-1.1.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-1.1.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-1.1.0/globals/String/raw.mdx | 45 ---- .../version-1.1.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-1.1.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-1.1.0/globals/Symbol/iterator.mdx | 26 -- .../version-1.1.0/globals/Symbol/keyFor.mdx | 25 -- .../version-1.1.0/globals/Symbol/match.mdx | 19 -- .../version-1.1.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-1.1.0/globals/Symbol/replace.mdx | 15 -- .../version-1.1.0/globals/Symbol/search.mdx | 15 -- .../version-1.1.0/globals/Symbol/species.mdx | 21 -- .../version-1.1.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-1.1.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-1.1.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-1.1.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-1.1.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-1.1.0/globals/atob.mdx | 37 --- .../version-1.1.0/globals/btoa.mdx | 38 --- .../version-1.1.0/globals/clearInterval.mdx | 35 --- .../version-1.1.0/globals/clearTimeout.mdx | 36 --- .../version-1.1.0/globals/console/debug.mdx | 26 -- .../version-1.1.0/globals/console/error.mdx | 26 -- .../version-1.1.0/globals/console/info.mdx | 26 -- .../version-1.1.0/globals/console/log.mdx | 30 --- .../version-1.1.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../version-1.1.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-1.1.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-1.1.0/globals/escape.mdx | 34 --- .../version-1.1.0/globals/eval.mdx | 36 --- .../version-1.1.0/globals/fetch.mdx | 62 ----- .../version-1.1.0/globals/globalThis.mdx | 20 -- .../version-1.1.0/globals/isFinite.mdx | 37 --- .../version-1.1.0/globals/isNaN.mdx | 36 --- .../version-1.1.0/globals/location.mdx | 18 -- .../version-1.1.0/globals/parseFloat.mdx | 41 ---- .../version-1.1.0/globals/parseInt.mdx | 68 ------ .../version-1.1.0/globals/setInterval.mdx | 61 ----- .../version-1.1.0/globals/setTimeout.mdx | 61 ----- .../version-1.1.0/globals/structuredClone.mdx | 33 --- .../version-1.1.0/globals/undefined.mdx | 25 -- .../version-1.1.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-1.1.0/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-1.10.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../ObjectStore/ObjectStore.mdx | 62 ----- .../ObjectStore/prototype/get.mdx | 68 ------ .../ObjectStore/prototype/put.mdx | 68 ------ .../AggregrateError/AggregrateError.mdx | 35 --- .../globals/Array/@@species.mdx | 57 ----- .../version-1.10.0/globals/Array/Array.mdx | 41 ---- .../version-1.10.0/globals/Array/from.mdx | 62 ----- .../version-1.10.0/globals/Array/isArray.mdx | 32 --- .../version-1.10.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-1.10.0/globals/BigInt/BigInt.mdx | 37 --- .../version-1.10.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-1.10.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-1.10.0/globals/Date/Date.mdx | 88 ------- .../version-1.10.0/globals/Date/UTC.mdx | 84 ------- .../version-1.10.0/globals/Date/now.mdx | 19 -- .../version-1.10.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-1.10.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-1.10.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-1.10.0/globals/JSON/parse.mdx | 50 ---- .../version-1.10.0/globals/JSON/stringify.mdx | 96 -------- .../version-1.10.0/globals/Map/@@species.mdx | 25 -- .../version-1.10.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-1.10.0/globals/Math/E.mdx | 17 -- .../version-1.10.0/globals/Math/LN10.mdx | 17 -- .../version-1.10.0/globals/Math/LN2.mdx | 17 -- .../version-1.10.0/globals/Math/LOG10e.mdx | 17 -- .../version-1.10.0/globals/Math/LOG2e.mdx | 17 -- .../version-1.10.0/globals/Math/PI.mdx | 17 -- .../version-1.10.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-1.10.0/globals/Math/SQRT2.mdx | 19 -- .../version-1.10.0/globals/Math/abs.mdx | 29 --- .../version-1.10.0/globals/Math/acos.mdx | 28 --- .../version-1.10.0/globals/Math/acosh.mdx | 28 --- .../version-1.10.0/globals/Math/asin.mdx | 28 --- .../version-1.10.0/globals/Math/asinh.mdx | 28 --- .../version-1.10.0/globals/Math/atan.mdx | 28 --- .../version-1.10.0/globals/Math/atan2.mdx | 51 ---- .../version-1.10.0/globals/Math/atanh.mdx | 29 --- .../version-1.10.0/globals/Math/cbrt.mdx | 28 --- .../version-1.10.0/globals/Math/ceil.mdx | 28 --- .../version-1.10.0/globals/Math/clz32.mdx | 34 --- .../version-1.10.0/globals/Math/cos.mdx | 28 --- .../version-1.10.0/globals/Math/cosh.mdx | 28 --- .../version-1.10.0/globals/Math/exp.mdx | 30 --- .../version-1.10.0/globals/Math/expm1.mdx | 32 --- .../version-1.10.0/globals/Math/floor.mdx | 28 --- .../version-1.10.0/globals/Math/fround.mdx | 32 --- .../version-1.10.0/globals/Math/hypot.mdx | 39 --- .../version-1.10.0/globals/Math/imul.mdx | 35 --- .../version-1.10.0/globals/Math/log.mdx | 32 --- .../version-1.10.0/globals/Math/log10.mdx | 30 --- .../version-1.10.0/globals/Math/log1p.mdx | 34 --- .../version-1.10.0/globals/Math/log2.mdx | 30 --- .../version-1.10.0/globals/Math/max.mdx | 33 --- .../version-1.10.0/globals/Math/min.mdx | 33 --- .../version-1.10.0/globals/Math/pow.mdx | 39 --- .../version-1.10.0/globals/Math/random.mdx | 21 -- .../version-1.10.0/globals/Math/round.mdx | 34 --- .../version-1.10.0/globals/Math/sign.mdx | 34 --- .../version-1.10.0/globals/Math/sin.mdx | 28 --- .../version-1.10.0/globals/Math/sinh.mdx | 29 --- .../version-1.10.0/globals/Math/sqrt.mdx | 29 --- .../version-1.10.0/globals/Math/tan.mdx | 31 --- .../version-1.10.0/globals/Math/tanh.mdx | 28 --- .../version-1.10.0/globals/Math/trunc.mdx | 30 --- .../version-1.10.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-1.10.0/globals/Number/NaN.mdx | 17 -- .../version-1.10.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-1.10.0/globals/Number/epsilon.mdx | 21 -- .../globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-1.10.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-1.10.0/globals/Object/Object.mdx | 27 --- .../version-1.10.0/globals/Object/assign.mdx | 57 ----- .../version-1.10.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-1.10.0/globals/Object/entries.mdx | 30 --- .../version-1.10.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-1.10.0/globals/Object/hasOwn.mdx | 46 ---- .../version-1.10.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../globals/Object/isFrozen.mdx | 31 --- .../globals/Object/isSealed.mdx | 32 --- .../version-1.10.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-1.10.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-1.10.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../globals/Promise/Promise.mdx | 140 ----------- .../version-1.10.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-1.10.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-1.10.0/globals/Promise/race.mdx | 30 --- .../version-1.10.0/globals/Promise/reject.mdx | 32 --- .../globals/Promise/resolve.mdx | 39 --- .../version-1.10.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-1.10.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-1.10.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-1.10.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-1.10.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../RsaHashedImportParams.mdx | 19 -- .../version-1.10.0/globals/Set/@@species.mdx | 25 -- .../version-1.10.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-1.10.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-1.10.0/globals/String/raw.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 87 ------- .../globals/SubtleCrypto/prototype/sign.mdx | 51 ---- .../globals/SubtleCrypto/prototype/verify.mdx | 51 ---- .../version-1.10.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-1.10.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../globals/Symbol/iterator.mdx | 26 -- .../version-1.10.0/globals/Symbol/keyFor.mdx | 25 -- .../version-1.10.0/globals/Symbol/match.mdx | 19 -- .../globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-1.10.0/globals/Symbol/replace.mdx | 15 -- .../version-1.10.0/globals/Symbol/search.mdx | 15 -- .../version-1.10.0/globals/Symbol/species.mdx | 21 -- .../version-1.10.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-1.10.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-1.10.0/globals/atob.mdx | 37 --- .../version-1.10.0/globals/btoa.mdx | 38 --- .../version-1.10.0/globals/clearInterval.mdx | 35 --- .../version-1.10.0/globals/clearTimeout.mdx | 36 --- .../version-1.10.0/globals/console/debug.mdx | 26 -- .../version-1.10.0/globals/console/error.mdx | 26 -- .../version-1.10.0/globals/console/info.mdx | 26 -- .../version-1.10.0/globals/console/log.mdx | 30 --- .../version-1.10.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-1.10.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-1.10.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-1.10.0/globals/escape.mdx | 34 --- .../version-1.10.0/globals/eval.mdx | 36 --- .../version-1.10.0/globals/fetch.mdx | 62 ----- .../version-1.10.0/globals/globalThis.mdx | 20 -- .../version-1.10.0/globals/isFinite.mdx | 37 --- .../version-1.10.0/globals/isNaN.mdx | 36 --- .../version-1.10.0/globals/location.mdx | 18 -- .../version-1.10.0/globals/parseFloat.mdx | 41 ---- .../version-1.10.0/globals/parseInt.mdx | 68 ------ .../version-1.10.0/globals/setInterval.mdx | 61 ----- .../version-1.10.0/globals/setTimeout.mdx | 61 ----- .../globals/structuredClone.mdx | 33 --- .../version-1.10.0/globals/undefined.mdx | 25 -- .../version-1.10.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-1.10.0/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-1.11.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../ObjectStore/ObjectStore.mdx | 62 ----- .../ObjectStore/prototype/get.mdx | 68 ------ .../ObjectStore/prototype/put.mdx | 68 ------ .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../globals/Array/@@species.mdx | 57 ----- .../version-1.11.0/globals/Array/Array.mdx | 41 ---- .../version-1.11.0/globals/Array/from.mdx | 62 ----- .../version-1.11.0/globals/Array/isArray.mdx | 32 --- .../version-1.11.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-1.11.0/globals/BigInt/BigInt.mdx | 37 --- .../version-1.11.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-1.11.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-1.11.0/globals/Date/Date.mdx | 88 ------- .../version-1.11.0/globals/Date/UTC.mdx | 84 ------- .../version-1.11.0/globals/Date/now.mdx | 19 -- .../version-1.11.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-1.11.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-1.11.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-1.11.0/globals/JSON/parse.mdx | 50 ---- .../version-1.11.0/globals/JSON/stringify.mdx | 96 -------- .../version-1.11.0/globals/Map/@@species.mdx | 25 -- .../version-1.11.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-1.11.0/globals/Math/E.mdx | 17 -- .../version-1.11.0/globals/Math/LN10.mdx | 17 -- .../version-1.11.0/globals/Math/LN2.mdx | 17 -- .../version-1.11.0/globals/Math/LOG10e.mdx | 17 -- .../version-1.11.0/globals/Math/LOG2e.mdx | 17 -- .../version-1.11.0/globals/Math/PI.mdx | 17 -- .../version-1.11.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-1.11.0/globals/Math/SQRT2.mdx | 19 -- .../version-1.11.0/globals/Math/abs.mdx | 29 --- .../version-1.11.0/globals/Math/acos.mdx | 28 --- .../version-1.11.0/globals/Math/acosh.mdx | 28 --- .../version-1.11.0/globals/Math/asin.mdx | 28 --- .../version-1.11.0/globals/Math/asinh.mdx | 28 --- .../version-1.11.0/globals/Math/atan.mdx | 28 --- .../version-1.11.0/globals/Math/atan2.mdx | 51 ---- .../version-1.11.0/globals/Math/atanh.mdx | 29 --- .../version-1.11.0/globals/Math/cbrt.mdx | 28 --- .../version-1.11.0/globals/Math/ceil.mdx | 28 --- .../version-1.11.0/globals/Math/clz32.mdx | 34 --- .../version-1.11.0/globals/Math/cos.mdx | 28 --- .../version-1.11.0/globals/Math/cosh.mdx | 28 --- .../version-1.11.0/globals/Math/exp.mdx | 30 --- .../version-1.11.0/globals/Math/expm1.mdx | 32 --- .../version-1.11.0/globals/Math/floor.mdx | 28 --- .../version-1.11.0/globals/Math/fround.mdx | 32 --- .../version-1.11.0/globals/Math/hypot.mdx | 39 --- .../version-1.11.0/globals/Math/imul.mdx | 35 --- .../version-1.11.0/globals/Math/log.mdx | 32 --- .../version-1.11.0/globals/Math/log10.mdx | 30 --- .../version-1.11.0/globals/Math/log1p.mdx | 34 --- .../version-1.11.0/globals/Math/log2.mdx | 30 --- .../version-1.11.0/globals/Math/max.mdx | 33 --- .../version-1.11.0/globals/Math/min.mdx | 33 --- .../version-1.11.0/globals/Math/pow.mdx | 39 --- .../version-1.11.0/globals/Math/random.mdx | 21 -- .../version-1.11.0/globals/Math/round.mdx | 34 --- .../version-1.11.0/globals/Math/sign.mdx | 34 --- .../version-1.11.0/globals/Math/sin.mdx | 28 --- .../version-1.11.0/globals/Math/sinh.mdx | 29 --- .../version-1.11.0/globals/Math/sqrt.mdx | 29 --- .../version-1.11.0/globals/Math/tan.mdx | 31 --- .../version-1.11.0/globals/Math/tanh.mdx | 28 --- .../version-1.11.0/globals/Math/trunc.mdx | 30 --- .../version-1.11.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-1.11.0/globals/Number/NaN.mdx | 17 -- .../version-1.11.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-1.11.0/globals/Number/epsilon.mdx | 21 -- .../globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-1.11.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-1.11.0/globals/Object/Object.mdx | 27 --- .../version-1.11.0/globals/Object/assign.mdx | 57 ----- .../version-1.11.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-1.11.0/globals/Object/entries.mdx | 30 --- .../version-1.11.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-1.11.0/globals/Object/hasOwn.mdx | 46 ---- .../version-1.11.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../globals/Object/isFrozen.mdx | 31 --- .../globals/Object/isSealed.mdx | 32 --- .../version-1.11.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-1.11.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-1.11.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../globals/Promise/Promise.mdx | 140 ----------- .../version-1.11.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-1.11.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-1.11.0/globals/Promise/race.mdx | 30 --- .../version-1.11.0/globals/Promise/reject.mdx | 32 --- .../globals/Promise/resolve.mdx | 39 --- .../version-1.11.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-1.11.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-1.11.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-1.11.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-1.11.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 19 -- .../version-1.11.0/globals/Set/@@species.mdx | 25 -- .../version-1.11.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-1.11.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-1.11.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 87 ------- .../globals/SubtleCrypto/prototype/sign.mdx | 51 ---- .../globals/SubtleCrypto/prototype/verify.mdx | 51 ---- .../version-1.11.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-1.11.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../globals/Symbol/iterator.mdx | 26 -- .../version-1.11.0/globals/Symbol/keyFor.mdx | 25 -- .../version-1.11.0/globals/Symbol/match.mdx | 19 -- .../globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-1.11.0/globals/Symbol/replace.mdx | 15 -- .../version-1.11.0/globals/Symbol/search.mdx | 15 -- .../version-1.11.0/globals/Symbol/species.mdx | 21 -- .../version-1.11.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-1.11.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-1.11.0/globals/atob.mdx | 37 --- .../version-1.11.0/globals/btoa.mdx | 38 --- .../version-1.11.0/globals/clearInterval.mdx | 35 --- .../version-1.11.0/globals/clearTimeout.mdx | 36 --- .../version-1.11.0/globals/console/debug.mdx | 26 -- .../version-1.11.0/globals/console/error.mdx | 26 -- .../version-1.11.0/globals/console/info.mdx | 26 -- .../version-1.11.0/globals/console/log.mdx | 30 --- .../version-1.11.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-1.11.0/globals/crypto/subtle.mdx | 16 -- .../version-1.11.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-1.11.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-1.11.0/globals/escape.mdx | 34 --- .../version-1.11.0/globals/eval.mdx | 36 --- .../version-1.11.0/globals/fetch.mdx | 62 ----- .../version-1.11.0/globals/globalThis.mdx | 20 -- .../version-1.11.0/globals/isFinite.mdx | 37 --- .../version-1.11.0/globals/isNaN.mdx | 36 --- .../version-1.11.0/globals/location.mdx | 18 -- .../version-1.11.0/globals/parseFloat.mdx | 41 ---- .../version-1.11.0/globals/parseInt.mdx | 68 ------ .../version-1.11.0/globals/setInterval.mdx | 61 ----- .../version-1.11.0/globals/setTimeout.mdx | 61 ----- .../globals/structuredClone.mdx | 33 --- .../version-1.11.0/globals/undefined.mdx | 25 -- .../version-1.11.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-1.11.0/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-1.12.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../ObjectStore/ObjectStore.mdx | 62 ----- .../ObjectStore/prototype/get.mdx | 68 ------ .../ObjectStore/prototype/put.mdx | 68 ------ .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../globals/Array/@@species.mdx | 57 ----- .../version-1.12.0/globals/Array/Array.mdx | 41 ---- .../version-1.12.0/globals/Array/from.mdx | 62 ----- .../version-1.12.0/globals/Array/isArray.mdx | 32 --- .../version-1.12.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-1.12.0/globals/BigInt/BigInt.mdx | 37 --- .../version-1.12.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-1.12.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-1.12.0/globals/Date/Date.mdx | 88 ------- .../version-1.12.0/globals/Date/UTC.mdx | 84 ------- .../version-1.12.0/globals/Date/now.mdx | 19 -- .../version-1.12.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-1.12.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-1.12.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-1.12.0/globals/JSON/parse.mdx | 50 ---- .../version-1.12.0/globals/JSON/stringify.mdx | 96 -------- .../version-1.12.0/globals/Map/@@species.mdx | 25 -- .../version-1.12.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-1.12.0/globals/Math/E.mdx | 17 -- .../version-1.12.0/globals/Math/LN10.mdx | 17 -- .../version-1.12.0/globals/Math/LN2.mdx | 17 -- .../version-1.12.0/globals/Math/LOG10e.mdx | 17 -- .../version-1.12.0/globals/Math/LOG2e.mdx | 17 -- .../version-1.12.0/globals/Math/PI.mdx | 17 -- .../version-1.12.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-1.12.0/globals/Math/SQRT2.mdx | 19 -- .../version-1.12.0/globals/Math/abs.mdx | 29 --- .../version-1.12.0/globals/Math/acos.mdx | 28 --- .../version-1.12.0/globals/Math/acosh.mdx | 28 --- .../version-1.12.0/globals/Math/asin.mdx | 28 --- .../version-1.12.0/globals/Math/asinh.mdx | 28 --- .../version-1.12.0/globals/Math/atan.mdx | 28 --- .../version-1.12.0/globals/Math/atan2.mdx | 51 ---- .../version-1.12.0/globals/Math/atanh.mdx | 29 --- .../version-1.12.0/globals/Math/cbrt.mdx | 28 --- .../version-1.12.0/globals/Math/ceil.mdx | 28 --- .../version-1.12.0/globals/Math/clz32.mdx | 34 --- .../version-1.12.0/globals/Math/cos.mdx | 28 --- .../version-1.12.0/globals/Math/cosh.mdx | 28 --- .../version-1.12.0/globals/Math/exp.mdx | 30 --- .../version-1.12.0/globals/Math/expm1.mdx | 32 --- .../version-1.12.0/globals/Math/floor.mdx | 28 --- .../version-1.12.0/globals/Math/fround.mdx | 32 --- .../version-1.12.0/globals/Math/hypot.mdx | 39 --- .../version-1.12.0/globals/Math/imul.mdx | 35 --- .../version-1.12.0/globals/Math/log.mdx | 32 --- .../version-1.12.0/globals/Math/log10.mdx | 30 --- .../version-1.12.0/globals/Math/log1p.mdx | 34 --- .../version-1.12.0/globals/Math/log2.mdx | 30 --- .../version-1.12.0/globals/Math/max.mdx | 33 --- .../version-1.12.0/globals/Math/min.mdx | 33 --- .../version-1.12.0/globals/Math/pow.mdx | 39 --- .../version-1.12.0/globals/Math/random.mdx | 21 -- .../version-1.12.0/globals/Math/round.mdx | 34 --- .../version-1.12.0/globals/Math/sign.mdx | 34 --- .../version-1.12.0/globals/Math/sin.mdx | 28 --- .../version-1.12.0/globals/Math/sinh.mdx | 29 --- .../version-1.12.0/globals/Math/sqrt.mdx | 29 --- .../version-1.12.0/globals/Math/tan.mdx | 31 --- .../version-1.12.0/globals/Math/tanh.mdx | 28 --- .../version-1.12.0/globals/Math/trunc.mdx | 30 --- .../version-1.12.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-1.12.0/globals/Number/NaN.mdx | 17 -- .../version-1.12.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-1.12.0/globals/Number/epsilon.mdx | 21 -- .../globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-1.12.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-1.12.0/globals/Object/Object.mdx | 27 --- .../version-1.12.0/globals/Object/assign.mdx | 57 ----- .../version-1.12.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-1.12.0/globals/Object/entries.mdx | 30 --- .../version-1.12.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-1.12.0/globals/Object/hasOwn.mdx | 46 ---- .../version-1.12.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../globals/Object/isFrozen.mdx | 31 --- .../globals/Object/isSealed.mdx | 32 --- .../version-1.12.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-1.12.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-1.12.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../globals/Promise/Promise.mdx | 140 ----------- .../version-1.12.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-1.12.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-1.12.0/globals/Promise/race.mdx | 30 --- .../version-1.12.0/globals/Promise/reject.mdx | 32 --- .../globals/Promise/resolve.mdx | 39 --- .../version-1.12.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-1.12.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-1.12.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-1.12.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-1.12.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 19 -- .../version-1.12.0/globals/Set/@@species.mdx | 25 -- .../version-1.12.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-1.12.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-1.12.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 87 ------- .../globals/SubtleCrypto/prototype/sign.mdx | 51 ---- .../globals/SubtleCrypto/prototype/verify.mdx | 51 ---- .../version-1.12.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-1.12.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../globals/Symbol/iterator.mdx | 26 -- .../version-1.12.0/globals/Symbol/keyFor.mdx | 25 -- .../version-1.12.0/globals/Symbol/match.mdx | 19 -- .../globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-1.12.0/globals/Symbol/replace.mdx | 15 -- .../version-1.12.0/globals/Symbol/search.mdx | 15 -- .../version-1.12.0/globals/Symbol/species.mdx | 21 -- .../version-1.12.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-1.12.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-1.12.0/globals/atob.mdx | 37 --- .../version-1.12.0/globals/btoa.mdx | 38 --- .../version-1.12.0/globals/clearInterval.mdx | 35 --- .../version-1.12.0/globals/clearTimeout.mdx | 36 --- .../version-1.12.0/globals/console/debug.mdx | 26 -- .../version-1.12.0/globals/console/error.mdx | 26 -- .../version-1.12.0/globals/console/info.mdx | 26 -- .../version-1.12.0/globals/console/log.mdx | 30 --- .../version-1.12.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-1.12.0/globals/crypto/subtle.mdx | 16 -- .../version-1.12.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-1.12.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-1.12.0/globals/escape.mdx | 34 --- .../version-1.12.0/globals/eval.mdx | 36 --- .../version-1.12.0/globals/fetch.mdx | 62 ----- .../version-1.12.0/globals/globalThis.mdx | 20 -- .../version-1.12.0/globals/isFinite.mdx | 37 --- .../version-1.12.0/globals/isNaN.mdx | 36 --- .../version-1.12.0/globals/location.mdx | 18 -- .../version-1.12.0/globals/parseFloat.mdx | 41 ---- .../version-1.12.0/globals/parseInt.mdx | 68 ------ .../version-1.12.0/globals/setInterval.mdx | 61 ----- .../version-1.12.0/globals/setTimeout.mdx | 61 ----- .../globals/structuredClone.mdx | 33 --- .../version-1.12.0/globals/undefined.mdx | 25 -- .../version-1.12.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-1.12.0/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-1.2.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../ObjectStore/ObjectStore.mdx | 62 ----- .../ObjectStore/prototype/get.mdx | 68 ------ .../ObjectStore/prototype/put.mdx | 68 ------ .../AggregrateError/AggregrateError.mdx | 35 --- .../version-1.2.0/globals/Array/@@species.mdx | 57 ----- .../version-1.2.0/globals/Array/Array.mdx | 41 ---- .../version-1.2.0/globals/Array/from.mdx | 62 ----- .../version-1.2.0/globals/Array/isArray.mdx | 32 --- .../version-1.2.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-1.2.0/globals/BigInt/BigInt.mdx | 37 --- .../version-1.2.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-1.2.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-1.2.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-1.2.0/globals/Date/Date.mdx | 88 ------- .../version-1.2.0/globals/Date/UTC.mdx | 84 ------- .../version-1.2.0/globals/Date/now.mdx | 19 -- .../version-1.2.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-1.2.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-1.2.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-1.2.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-1.2.0/globals/JSON/parse.mdx | 50 ---- .../version-1.2.0/globals/JSON/stringify.mdx | 96 -------- .../version-1.2.0/globals/Map/@@species.mdx | 25 -- .../version-1.2.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-1.2.0/globals/Math/E.mdx | 17 -- .../version-1.2.0/globals/Math/LN10.mdx | 17 -- .../version-1.2.0/globals/Math/LN2.mdx | 17 -- .../version-1.2.0/globals/Math/LOG10e.mdx | 17 -- .../version-1.2.0/globals/Math/LOG2e.mdx | 17 -- .../version-1.2.0/globals/Math/PI.mdx | 17 -- .../version-1.2.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-1.2.0/globals/Math/SQRT2.mdx | 19 -- .../version-1.2.0/globals/Math/abs.mdx | 29 --- .../version-1.2.0/globals/Math/acos.mdx | 28 --- .../version-1.2.0/globals/Math/acosh.mdx | 28 --- .../version-1.2.0/globals/Math/asin.mdx | 28 --- .../version-1.2.0/globals/Math/asinh.mdx | 28 --- .../version-1.2.0/globals/Math/atan.mdx | 28 --- .../version-1.2.0/globals/Math/atan2.mdx | 51 ---- .../version-1.2.0/globals/Math/atanh.mdx | 29 --- .../version-1.2.0/globals/Math/cbrt.mdx | 28 --- .../version-1.2.0/globals/Math/ceil.mdx | 28 --- .../version-1.2.0/globals/Math/clz32.mdx | 34 --- .../version-1.2.0/globals/Math/cos.mdx | 28 --- .../version-1.2.0/globals/Math/cosh.mdx | 28 --- .../version-1.2.0/globals/Math/exp.mdx | 30 --- .../version-1.2.0/globals/Math/expm1.mdx | 32 --- .../version-1.2.0/globals/Math/floor.mdx | 28 --- .../version-1.2.0/globals/Math/fround.mdx | 32 --- .../version-1.2.0/globals/Math/hypot.mdx | 39 --- .../version-1.2.0/globals/Math/imul.mdx | 35 --- .../version-1.2.0/globals/Math/log.mdx | 32 --- .../version-1.2.0/globals/Math/log10.mdx | 30 --- .../version-1.2.0/globals/Math/log1p.mdx | 34 --- .../version-1.2.0/globals/Math/log2.mdx | 30 --- .../version-1.2.0/globals/Math/max.mdx | 33 --- .../version-1.2.0/globals/Math/min.mdx | 33 --- .../version-1.2.0/globals/Math/pow.mdx | 39 --- .../version-1.2.0/globals/Math/random.mdx | 21 -- .../version-1.2.0/globals/Math/round.mdx | 34 --- .../version-1.2.0/globals/Math/sign.mdx | 34 --- .../version-1.2.0/globals/Math/sin.mdx | 28 --- .../version-1.2.0/globals/Math/sinh.mdx | 29 --- .../version-1.2.0/globals/Math/sqrt.mdx | 29 --- .../version-1.2.0/globals/Math/tan.mdx | 31 --- .../version-1.2.0/globals/Math/tanh.mdx | 28 --- .../version-1.2.0/globals/Math/trunc.mdx | 30 --- .../version-1.2.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-1.2.0/globals/Number/NaN.mdx | 17 -- .../version-1.2.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-1.2.0/globals/Number/epsilon.mdx | 21 -- .../version-1.2.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-1.2.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-1.2.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-1.2.0/globals/Object/Object.mdx | 27 --- .../version-1.2.0/globals/Object/assign.mdx | 57 ----- .../version-1.2.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-1.2.0/globals/Object/entries.mdx | 30 --- .../version-1.2.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-1.2.0/globals/Object/hasOwn.mdx | 46 ---- .../version-1.2.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-1.2.0/globals/Object/isFrozen.mdx | 31 --- .../version-1.2.0/globals/Object/isSealed.mdx | 32 --- .../version-1.2.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-1.2.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-1.2.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-1.2.0/globals/Promise/Promise.mdx | 140 ----------- .../version-1.2.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-1.2.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-1.2.0/globals/Promise/race.mdx | 30 --- .../version-1.2.0/globals/Promise/reject.mdx | 32 --- .../version-1.2.0/globals/Promise/resolve.mdx | 39 --- .../version-1.2.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-1.2.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-1.2.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-1.2.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-1.2.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-1.2.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-1.2.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-1.2.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-1.2.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-1.2.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-1.2.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../version-1.2.0/globals/Set/@@species.mdx | 25 -- .../version-1.2.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-1.2.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-1.2.0/globals/String/raw.mdx | 45 ---- .../version-1.2.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-1.2.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-1.2.0/globals/Symbol/iterator.mdx | 26 -- .../version-1.2.0/globals/Symbol/keyFor.mdx | 25 -- .../version-1.2.0/globals/Symbol/match.mdx | 19 -- .../version-1.2.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-1.2.0/globals/Symbol/replace.mdx | 15 -- .../version-1.2.0/globals/Symbol/search.mdx | 15 -- .../version-1.2.0/globals/Symbol/species.mdx | 21 -- .../version-1.2.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-1.2.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-1.2.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-1.2.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-1.2.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-1.2.0/globals/atob.mdx | 37 --- .../version-1.2.0/globals/btoa.mdx | 38 --- .../version-1.2.0/globals/clearInterval.mdx | 35 --- .../version-1.2.0/globals/clearTimeout.mdx | 36 --- .../version-1.2.0/globals/console/debug.mdx | 26 -- .../version-1.2.0/globals/console/error.mdx | 26 -- .../version-1.2.0/globals/console/info.mdx | 26 -- .../version-1.2.0/globals/console/log.mdx | 30 --- .../version-1.2.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-1.2.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-1.2.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-1.2.0/globals/escape.mdx | 34 --- .../version-1.2.0/globals/eval.mdx | 36 --- .../version-1.2.0/globals/fetch.mdx | 62 ----- .../version-1.2.0/globals/globalThis.mdx | 20 -- .../version-1.2.0/globals/isFinite.mdx | 37 --- .../version-1.2.0/globals/isNaN.mdx | 36 --- .../version-1.2.0/globals/location.mdx | 18 -- .../version-1.2.0/globals/parseFloat.mdx | 41 ---- .../version-1.2.0/globals/parseInt.mdx | 68 ------ .../version-1.2.0/globals/setInterval.mdx | 61 ----- .../version-1.2.0/globals/setTimeout.mdx | 61 ----- .../version-1.2.0/globals/structuredClone.mdx | 33 --- .../version-1.2.0/globals/undefined.mdx | 25 -- .../version-1.2.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-1.2.0/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-1.3.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../ObjectStore/ObjectStore.mdx | 62 ----- .../ObjectStore/prototype/get.mdx | 68 ------ .../ObjectStore/prototype/put.mdx | 68 ------ .../AggregrateError/AggregrateError.mdx | 35 --- .../version-1.3.0/globals/Array/@@species.mdx | 57 ----- .../version-1.3.0/globals/Array/Array.mdx | 41 ---- .../version-1.3.0/globals/Array/from.mdx | 62 ----- .../version-1.3.0/globals/Array/isArray.mdx | 32 --- .../version-1.3.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-1.3.0/globals/BigInt/BigInt.mdx | 37 --- .../version-1.3.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-1.3.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-1.3.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-1.3.0/globals/Date/Date.mdx | 88 ------- .../version-1.3.0/globals/Date/UTC.mdx | 84 ------- .../version-1.3.0/globals/Date/now.mdx | 19 -- .../version-1.3.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-1.3.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-1.3.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-1.3.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-1.3.0/globals/JSON/parse.mdx | 50 ---- .../version-1.3.0/globals/JSON/stringify.mdx | 96 -------- .../version-1.3.0/globals/Map/@@species.mdx | 25 -- .../version-1.3.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-1.3.0/globals/Math/E.mdx | 17 -- .../version-1.3.0/globals/Math/LN10.mdx | 17 -- .../version-1.3.0/globals/Math/LN2.mdx | 17 -- .../version-1.3.0/globals/Math/LOG10e.mdx | 17 -- .../version-1.3.0/globals/Math/LOG2e.mdx | 17 -- .../version-1.3.0/globals/Math/PI.mdx | 17 -- .../version-1.3.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-1.3.0/globals/Math/SQRT2.mdx | 19 -- .../version-1.3.0/globals/Math/abs.mdx | 29 --- .../version-1.3.0/globals/Math/acos.mdx | 28 --- .../version-1.3.0/globals/Math/acosh.mdx | 28 --- .../version-1.3.0/globals/Math/asin.mdx | 28 --- .../version-1.3.0/globals/Math/asinh.mdx | 28 --- .../version-1.3.0/globals/Math/atan.mdx | 28 --- .../version-1.3.0/globals/Math/atan2.mdx | 51 ---- .../version-1.3.0/globals/Math/atanh.mdx | 29 --- .../version-1.3.0/globals/Math/cbrt.mdx | 28 --- .../version-1.3.0/globals/Math/ceil.mdx | 28 --- .../version-1.3.0/globals/Math/clz32.mdx | 34 --- .../version-1.3.0/globals/Math/cos.mdx | 28 --- .../version-1.3.0/globals/Math/cosh.mdx | 28 --- .../version-1.3.0/globals/Math/exp.mdx | 30 --- .../version-1.3.0/globals/Math/expm1.mdx | 32 --- .../version-1.3.0/globals/Math/floor.mdx | 28 --- .../version-1.3.0/globals/Math/fround.mdx | 32 --- .../version-1.3.0/globals/Math/hypot.mdx | 39 --- .../version-1.3.0/globals/Math/imul.mdx | 35 --- .../version-1.3.0/globals/Math/log.mdx | 32 --- .../version-1.3.0/globals/Math/log10.mdx | 30 --- .../version-1.3.0/globals/Math/log1p.mdx | 34 --- .../version-1.3.0/globals/Math/log2.mdx | 30 --- .../version-1.3.0/globals/Math/max.mdx | 33 --- .../version-1.3.0/globals/Math/min.mdx | 33 --- .../version-1.3.0/globals/Math/pow.mdx | 39 --- .../version-1.3.0/globals/Math/random.mdx | 21 -- .../version-1.3.0/globals/Math/round.mdx | 34 --- .../version-1.3.0/globals/Math/sign.mdx | 34 --- .../version-1.3.0/globals/Math/sin.mdx | 28 --- .../version-1.3.0/globals/Math/sinh.mdx | 29 --- .../version-1.3.0/globals/Math/sqrt.mdx | 29 --- .../version-1.3.0/globals/Math/tan.mdx | 31 --- .../version-1.3.0/globals/Math/tanh.mdx | 28 --- .../version-1.3.0/globals/Math/trunc.mdx | 30 --- .../version-1.3.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-1.3.0/globals/Number/NaN.mdx | 17 -- .../version-1.3.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-1.3.0/globals/Number/epsilon.mdx | 21 -- .../version-1.3.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-1.3.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-1.3.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-1.3.0/globals/Object/Object.mdx | 27 --- .../version-1.3.0/globals/Object/assign.mdx | 57 ----- .../version-1.3.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-1.3.0/globals/Object/entries.mdx | 30 --- .../version-1.3.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-1.3.0/globals/Object/hasOwn.mdx | 46 ---- .../version-1.3.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-1.3.0/globals/Object/isFrozen.mdx | 31 --- .../version-1.3.0/globals/Object/isSealed.mdx | 32 --- .../version-1.3.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-1.3.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-1.3.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-1.3.0/globals/Promise/Promise.mdx | 140 ----------- .../version-1.3.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-1.3.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-1.3.0/globals/Promise/race.mdx | 30 --- .../version-1.3.0/globals/Promise/reject.mdx | 32 --- .../version-1.3.0/globals/Promise/resolve.mdx | 39 --- .../version-1.3.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-1.3.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-1.3.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-1.3.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-1.3.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-1.3.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-1.3.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-1.3.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-1.3.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-1.3.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-1.3.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../version-1.3.0/globals/Set/@@species.mdx | 25 -- .../version-1.3.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-1.3.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-1.3.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 38 --- .../globals/SubtleCrypto/prototype/digest.mdx | 44 ---- .../version-1.3.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-1.3.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-1.3.0/globals/Symbol/iterator.mdx | 26 -- .../version-1.3.0/globals/Symbol/keyFor.mdx | 25 -- .../version-1.3.0/globals/Symbol/match.mdx | 19 -- .../version-1.3.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-1.3.0/globals/Symbol/replace.mdx | 15 -- .../version-1.3.0/globals/Symbol/search.mdx | 15 -- .../version-1.3.0/globals/Symbol/species.mdx | 21 -- .../version-1.3.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-1.3.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-1.3.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-1.3.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-1.3.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-1.3.0/globals/atob.mdx | 37 --- .../version-1.3.0/globals/btoa.mdx | 38 --- .../version-1.3.0/globals/clearInterval.mdx | 35 --- .../version-1.3.0/globals/clearTimeout.mdx | 36 --- .../version-1.3.0/globals/console/debug.mdx | 26 -- .../version-1.3.0/globals/console/error.mdx | 26 -- .../version-1.3.0/globals/console/info.mdx | 26 -- .../version-1.3.0/globals/console/log.mdx | 30 --- .../version-1.3.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-1.3.0/globals/crypto/subtle.mdx | 16 -- .../version-1.3.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-1.3.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-1.3.0/globals/escape.mdx | 34 --- .../version-1.3.0/globals/eval.mdx | 36 --- .../version-1.3.0/globals/fetch.mdx | 62 ----- .../version-1.3.0/globals/globalThis.mdx | 20 -- .../version-1.3.0/globals/isFinite.mdx | 37 --- .../version-1.3.0/globals/isNaN.mdx | 36 --- .../version-1.3.0/globals/location.mdx | 18 -- .../version-1.3.0/globals/parseFloat.mdx | 41 ---- .../version-1.3.0/globals/parseInt.mdx | 68 ------ .../version-1.3.0/globals/setInterval.mdx | 61 ----- .../version-1.3.0/globals/setTimeout.mdx | 61 ----- .../version-1.3.0/globals/structuredClone.mdx | 33 --- .../version-1.3.0/globals/undefined.mdx | 25 -- .../version-1.3.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-1.3.0/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-1.4.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../ObjectStore/ObjectStore.mdx | 62 ----- .../ObjectStore/prototype/get.mdx | 68 ------ .../ObjectStore/prototype/put.mdx | 68 ------ .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-1.4.0/globals/Array/@@species.mdx | 57 ----- .../version-1.4.0/globals/Array/Array.mdx | 41 ---- .../version-1.4.0/globals/Array/from.mdx | 62 ----- .../version-1.4.0/globals/Array/isArray.mdx | 32 --- .../version-1.4.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-1.4.0/globals/BigInt/BigInt.mdx | 37 --- .../version-1.4.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-1.4.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-1.4.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-1.4.0/globals/Date/Date.mdx | 88 ------- .../version-1.4.0/globals/Date/UTC.mdx | 84 ------- .../version-1.4.0/globals/Date/now.mdx | 19 -- .../version-1.4.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-1.4.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-1.4.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-1.4.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-1.4.0/globals/JSON/parse.mdx | 50 ---- .../version-1.4.0/globals/JSON/stringify.mdx | 96 -------- .../version-1.4.0/globals/Map/@@species.mdx | 25 -- .../version-1.4.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-1.4.0/globals/Math/E.mdx | 17 -- .../version-1.4.0/globals/Math/LN10.mdx | 17 -- .../version-1.4.0/globals/Math/LN2.mdx | 17 -- .../version-1.4.0/globals/Math/LOG10e.mdx | 17 -- .../version-1.4.0/globals/Math/LOG2e.mdx | 17 -- .../version-1.4.0/globals/Math/PI.mdx | 17 -- .../version-1.4.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-1.4.0/globals/Math/SQRT2.mdx | 19 -- .../version-1.4.0/globals/Math/abs.mdx | 29 --- .../version-1.4.0/globals/Math/acos.mdx | 28 --- .../version-1.4.0/globals/Math/acosh.mdx | 28 --- .../version-1.4.0/globals/Math/asin.mdx | 28 --- .../version-1.4.0/globals/Math/asinh.mdx | 28 --- .../version-1.4.0/globals/Math/atan.mdx | 28 --- .../version-1.4.0/globals/Math/atan2.mdx | 51 ---- .../version-1.4.0/globals/Math/atanh.mdx | 29 --- .../version-1.4.0/globals/Math/cbrt.mdx | 28 --- .../version-1.4.0/globals/Math/ceil.mdx | 28 --- .../version-1.4.0/globals/Math/clz32.mdx | 34 --- .../version-1.4.0/globals/Math/cos.mdx | 28 --- .../version-1.4.0/globals/Math/cosh.mdx | 28 --- .../version-1.4.0/globals/Math/exp.mdx | 30 --- .../version-1.4.0/globals/Math/expm1.mdx | 32 --- .../version-1.4.0/globals/Math/floor.mdx | 28 --- .../version-1.4.0/globals/Math/fround.mdx | 32 --- .../version-1.4.0/globals/Math/hypot.mdx | 39 --- .../version-1.4.0/globals/Math/imul.mdx | 35 --- .../version-1.4.0/globals/Math/log.mdx | 32 --- .../version-1.4.0/globals/Math/log10.mdx | 30 --- .../version-1.4.0/globals/Math/log1p.mdx | 34 --- .../version-1.4.0/globals/Math/log2.mdx | 30 --- .../version-1.4.0/globals/Math/max.mdx | 33 --- .../version-1.4.0/globals/Math/min.mdx | 33 --- .../version-1.4.0/globals/Math/pow.mdx | 39 --- .../version-1.4.0/globals/Math/random.mdx | 21 -- .../version-1.4.0/globals/Math/round.mdx | 34 --- .../version-1.4.0/globals/Math/sign.mdx | 34 --- .../version-1.4.0/globals/Math/sin.mdx | 28 --- .../version-1.4.0/globals/Math/sinh.mdx | 29 --- .../version-1.4.0/globals/Math/sqrt.mdx | 29 --- .../version-1.4.0/globals/Math/tan.mdx | 31 --- .../version-1.4.0/globals/Math/tanh.mdx | 28 --- .../version-1.4.0/globals/Math/trunc.mdx | 30 --- .../version-1.4.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-1.4.0/globals/Number/NaN.mdx | 17 -- .../version-1.4.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-1.4.0/globals/Number/epsilon.mdx | 21 -- .../version-1.4.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-1.4.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-1.4.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-1.4.0/globals/Object/Object.mdx | 27 --- .../version-1.4.0/globals/Object/assign.mdx | 57 ----- .../version-1.4.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-1.4.0/globals/Object/entries.mdx | 30 --- .../version-1.4.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-1.4.0/globals/Object/hasOwn.mdx | 46 ---- .../version-1.4.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-1.4.0/globals/Object/isFrozen.mdx | 31 --- .../version-1.4.0/globals/Object/isSealed.mdx | 32 --- .../version-1.4.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-1.4.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-1.4.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-1.4.0/globals/Promise/Promise.mdx | 140 ----------- .../version-1.4.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-1.4.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-1.4.0/globals/Promise/race.mdx | 30 --- .../version-1.4.0/globals/Promise/reject.mdx | 32 --- .../version-1.4.0/globals/Promise/resolve.mdx | 39 --- .../version-1.4.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-1.4.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-1.4.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-1.4.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-1.4.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-1.4.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-1.4.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-1.4.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-1.4.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-1.4.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-1.4.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../version-1.4.0/globals/Set/@@species.mdx | 25 -- .../version-1.4.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-1.4.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-1.4.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 38 --- .../globals/SubtleCrypto/prototype/digest.mdx | 44 ---- .../version-1.4.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-1.4.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-1.4.0/globals/Symbol/iterator.mdx | 26 -- .../version-1.4.0/globals/Symbol/keyFor.mdx | 25 -- .../version-1.4.0/globals/Symbol/match.mdx | 19 -- .../version-1.4.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-1.4.0/globals/Symbol/replace.mdx | 15 -- .../version-1.4.0/globals/Symbol/search.mdx | 15 -- .../version-1.4.0/globals/Symbol/species.mdx | 21 -- .../version-1.4.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-1.4.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-1.4.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-1.4.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-1.4.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-1.4.0/globals/atob.mdx | 37 --- .../version-1.4.0/globals/btoa.mdx | 38 --- .../version-1.4.0/globals/clearInterval.mdx | 35 --- .../version-1.4.0/globals/clearTimeout.mdx | 36 --- .../version-1.4.0/globals/console/debug.mdx | 26 -- .../version-1.4.0/globals/console/error.mdx | 26 -- .../version-1.4.0/globals/console/info.mdx | 26 -- .../version-1.4.0/globals/console/log.mdx | 30 --- .../version-1.4.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-1.4.0/globals/crypto/subtle.mdx | 16 -- .../version-1.4.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-1.4.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-1.4.0/globals/escape.mdx | 34 --- .../version-1.4.0/globals/eval.mdx | 36 --- .../version-1.4.0/globals/fetch.mdx | 62 ----- .../version-1.4.0/globals/globalThis.mdx | 20 -- .../version-1.4.0/globals/isFinite.mdx | 37 --- .../version-1.4.0/globals/isNaN.mdx | 36 --- .../version-1.4.0/globals/location.mdx | 18 -- .../version-1.4.0/globals/parseFloat.mdx | 41 ---- .../version-1.4.0/globals/parseInt.mdx | 68 ------ .../version-1.4.0/globals/setInterval.mdx | 61 ----- .../version-1.4.0/globals/setTimeout.mdx | 61 ----- .../version-1.4.0/globals/structuredClone.mdx | 33 --- .../version-1.4.0/globals/undefined.mdx | 25 -- .../version-1.4.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-1.4.0/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-1.5.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../ObjectStore/ObjectStore.mdx | 62 ----- .../ObjectStore/prototype/get.mdx | 68 ------ .../ObjectStore/prototype/put.mdx | 68 ------ .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-1.5.0/globals/Array/@@species.mdx | 57 ----- .../version-1.5.0/globals/Array/Array.mdx | 41 ---- .../version-1.5.0/globals/Array/from.mdx | 62 ----- .../version-1.5.0/globals/Array/isArray.mdx | 32 --- .../version-1.5.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-1.5.0/globals/BigInt/BigInt.mdx | 37 --- .../version-1.5.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-1.5.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-1.5.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-1.5.0/globals/Date/Date.mdx | 88 ------- .../version-1.5.0/globals/Date/UTC.mdx | 84 ------- .../version-1.5.0/globals/Date/now.mdx | 19 -- .../version-1.5.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-1.5.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-1.5.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-1.5.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-1.5.0/globals/JSON/parse.mdx | 50 ---- .../version-1.5.0/globals/JSON/stringify.mdx | 96 -------- .../version-1.5.0/globals/Map/@@species.mdx | 25 -- .../version-1.5.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-1.5.0/globals/Math/E.mdx | 17 -- .../version-1.5.0/globals/Math/LN10.mdx | 17 -- .../version-1.5.0/globals/Math/LN2.mdx | 17 -- .../version-1.5.0/globals/Math/LOG10e.mdx | 17 -- .../version-1.5.0/globals/Math/LOG2e.mdx | 17 -- .../version-1.5.0/globals/Math/PI.mdx | 17 -- .../version-1.5.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-1.5.0/globals/Math/SQRT2.mdx | 19 -- .../version-1.5.0/globals/Math/abs.mdx | 29 --- .../version-1.5.0/globals/Math/acos.mdx | 28 --- .../version-1.5.0/globals/Math/acosh.mdx | 28 --- .../version-1.5.0/globals/Math/asin.mdx | 28 --- .../version-1.5.0/globals/Math/asinh.mdx | 28 --- .../version-1.5.0/globals/Math/atan.mdx | 28 --- .../version-1.5.0/globals/Math/atan2.mdx | 51 ---- .../version-1.5.0/globals/Math/atanh.mdx | 29 --- .../version-1.5.0/globals/Math/cbrt.mdx | 28 --- .../version-1.5.0/globals/Math/ceil.mdx | 28 --- .../version-1.5.0/globals/Math/clz32.mdx | 34 --- .../version-1.5.0/globals/Math/cos.mdx | 28 --- .../version-1.5.0/globals/Math/cosh.mdx | 28 --- .../version-1.5.0/globals/Math/exp.mdx | 30 --- .../version-1.5.0/globals/Math/expm1.mdx | 32 --- .../version-1.5.0/globals/Math/floor.mdx | 28 --- .../version-1.5.0/globals/Math/fround.mdx | 32 --- .../version-1.5.0/globals/Math/hypot.mdx | 39 --- .../version-1.5.0/globals/Math/imul.mdx | 35 --- .../version-1.5.0/globals/Math/log.mdx | 32 --- .../version-1.5.0/globals/Math/log10.mdx | 30 --- .../version-1.5.0/globals/Math/log1p.mdx | 34 --- .../version-1.5.0/globals/Math/log2.mdx | 30 --- .../version-1.5.0/globals/Math/max.mdx | 33 --- .../version-1.5.0/globals/Math/min.mdx | 33 --- .../version-1.5.0/globals/Math/pow.mdx | 39 --- .../version-1.5.0/globals/Math/random.mdx | 21 -- .../version-1.5.0/globals/Math/round.mdx | 34 --- .../version-1.5.0/globals/Math/sign.mdx | 34 --- .../version-1.5.0/globals/Math/sin.mdx | 28 --- .../version-1.5.0/globals/Math/sinh.mdx | 29 --- .../version-1.5.0/globals/Math/sqrt.mdx | 29 --- .../version-1.5.0/globals/Math/tan.mdx | 31 --- .../version-1.5.0/globals/Math/tanh.mdx | 28 --- .../version-1.5.0/globals/Math/trunc.mdx | 30 --- .../version-1.5.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-1.5.0/globals/Number/NaN.mdx | 17 -- .../version-1.5.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-1.5.0/globals/Number/epsilon.mdx | 21 -- .../version-1.5.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-1.5.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-1.5.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-1.5.0/globals/Object/Object.mdx | 27 --- .../version-1.5.0/globals/Object/assign.mdx | 57 ----- .../version-1.5.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-1.5.0/globals/Object/entries.mdx | 30 --- .../version-1.5.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-1.5.0/globals/Object/hasOwn.mdx | 46 ---- .../version-1.5.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-1.5.0/globals/Object/isFrozen.mdx | 31 --- .../version-1.5.0/globals/Object/isSealed.mdx | 32 --- .../version-1.5.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-1.5.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-1.5.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-1.5.0/globals/Promise/Promise.mdx | 140 ----------- .../version-1.5.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-1.5.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-1.5.0/globals/Promise/race.mdx | 30 --- .../version-1.5.0/globals/Promise/reject.mdx | 32 --- .../version-1.5.0/globals/Promise/resolve.mdx | 39 --- .../version-1.5.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-1.5.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-1.5.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-1.5.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-1.5.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-1.5.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-1.5.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-1.5.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-1.5.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-1.5.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-1.5.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../version-1.5.0/globals/Set/@@species.mdx | 25 -- .../version-1.5.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-1.5.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-1.5.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 38 --- .../globals/SubtleCrypto/prototype/digest.mdx | 44 ---- .../version-1.5.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-1.5.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-1.5.0/globals/Symbol/iterator.mdx | 26 -- .../version-1.5.0/globals/Symbol/keyFor.mdx | 25 -- .../version-1.5.0/globals/Symbol/match.mdx | 19 -- .../version-1.5.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-1.5.0/globals/Symbol/replace.mdx | 15 -- .../version-1.5.0/globals/Symbol/search.mdx | 15 -- .../version-1.5.0/globals/Symbol/species.mdx | 21 -- .../version-1.5.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-1.5.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-1.5.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-1.5.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-1.5.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-1.5.0/globals/atob.mdx | 37 --- .../version-1.5.0/globals/btoa.mdx | 38 --- .../version-1.5.0/globals/clearInterval.mdx | 35 --- .../version-1.5.0/globals/clearTimeout.mdx | 36 --- .../version-1.5.0/globals/console/debug.mdx | 26 -- .../version-1.5.0/globals/console/error.mdx | 26 -- .../version-1.5.0/globals/console/info.mdx | 26 -- .../version-1.5.0/globals/console/log.mdx | 30 --- .../version-1.5.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-1.5.0/globals/crypto/subtle.mdx | 16 -- .../version-1.5.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-1.5.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-1.5.0/globals/escape.mdx | 34 --- .../version-1.5.0/globals/eval.mdx | 36 --- .../version-1.5.0/globals/fetch.mdx | 62 ----- .../version-1.5.0/globals/globalThis.mdx | 20 -- .../version-1.5.0/globals/isFinite.mdx | 37 --- .../version-1.5.0/globals/isNaN.mdx | 36 --- .../version-1.5.0/globals/location.mdx | 18 -- .../version-1.5.0/globals/parseFloat.mdx | 41 ---- .../version-1.5.0/globals/parseInt.mdx | 68 ------ .../version-1.5.0/globals/setInterval.mdx | 61 ----- .../version-1.5.0/globals/setTimeout.mdx | 61 ----- .../version-1.5.0/globals/structuredClone.mdx | 33 --- .../version-1.5.0/globals/undefined.mdx | 25 -- .../version-1.5.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-1.5.0/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-1.6.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../ObjectStore/ObjectStore.mdx | 62 ----- .../ObjectStore/prototype/get.mdx | 68 ------ .../ObjectStore/prototype/put.mdx | 68 ------ .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-1.6.0/globals/Array/@@species.mdx | 57 ----- .../version-1.6.0/globals/Array/Array.mdx | 41 ---- .../version-1.6.0/globals/Array/from.mdx | 62 ----- .../version-1.6.0/globals/Array/isArray.mdx | 32 --- .../version-1.6.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-1.6.0/globals/BigInt/BigInt.mdx | 37 --- .../version-1.6.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-1.6.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-1.6.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-1.6.0/globals/Date/Date.mdx | 88 ------- .../version-1.6.0/globals/Date/UTC.mdx | 84 ------- .../version-1.6.0/globals/Date/now.mdx | 19 -- .../version-1.6.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-1.6.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-1.6.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-1.6.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-1.6.0/globals/JSON/parse.mdx | 50 ---- .../version-1.6.0/globals/JSON/stringify.mdx | 96 -------- .../version-1.6.0/globals/Map/@@species.mdx | 25 -- .../version-1.6.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-1.6.0/globals/Math/E.mdx | 17 -- .../version-1.6.0/globals/Math/LN10.mdx | 17 -- .../version-1.6.0/globals/Math/LN2.mdx | 17 -- .../version-1.6.0/globals/Math/LOG10e.mdx | 17 -- .../version-1.6.0/globals/Math/LOG2e.mdx | 17 -- .../version-1.6.0/globals/Math/PI.mdx | 17 -- .../version-1.6.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-1.6.0/globals/Math/SQRT2.mdx | 19 -- .../version-1.6.0/globals/Math/abs.mdx | 29 --- .../version-1.6.0/globals/Math/acos.mdx | 28 --- .../version-1.6.0/globals/Math/acosh.mdx | 28 --- .../version-1.6.0/globals/Math/asin.mdx | 28 --- .../version-1.6.0/globals/Math/asinh.mdx | 28 --- .../version-1.6.0/globals/Math/atan.mdx | 28 --- .../version-1.6.0/globals/Math/atan2.mdx | 51 ---- .../version-1.6.0/globals/Math/atanh.mdx | 29 --- .../version-1.6.0/globals/Math/cbrt.mdx | 28 --- .../version-1.6.0/globals/Math/ceil.mdx | 28 --- .../version-1.6.0/globals/Math/clz32.mdx | 34 --- .../version-1.6.0/globals/Math/cos.mdx | 28 --- .../version-1.6.0/globals/Math/cosh.mdx | 28 --- .../version-1.6.0/globals/Math/exp.mdx | 30 --- .../version-1.6.0/globals/Math/expm1.mdx | 32 --- .../version-1.6.0/globals/Math/floor.mdx | 28 --- .../version-1.6.0/globals/Math/fround.mdx | 32 --- .../version-1.6.0/globals/Math/hypot.mdx | 39 --- .../version-1.6.0/globals/Math/imul.mdx | 35 --- .../version-1.6.0/globals/Math/log.mdx | 32 --- .../version-1.6.0/globals/Math/log10.mdx | 30 --- .../version-1.6.0/globals/Math/log1p.mdx | 34 --- .../version-1.6.0/globals/Math/log2.mdx | 30 --- .../version-1.6.0/globals/Math/max.mdx | 33 --- .../version-1.6.0/globals/Math/min.mdx | 33 --- .../version-1.6.0/globals/Math/pow.mdx | 39 --- .../version-1.6.0/globals/Math/random.mdx | 21 -- .../version-1.6.0/globals/Math/round.mdx | 34 --- .../version-1.6.0/globals/Math/sign.mdx | 34 --- .../version-1.6.0/globals/Math/sin.mdx | 28 --- .../version-1.6.0/globals/Math/sinh.mdx | 29 --- .../version-1.6.0/globals/Math/sqrt.mdx | 29 --- .../version-1.6.0/globals/Math/tan.mdx | 31 --- .../version-1.6.0/globals/Math/tanh.mdx | 28 --- .../version-1.6.0/globals/Math/trunc.mdx | 30 --- .../version-1.6.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-1.6.0/globals/Number/NaN.mdx | 17 -- .../version-1.6.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-1.6.0/globals/Number/epsilon.mdx | 21 -- .../version-1.6.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-1.6.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-1.6.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-1.6.0/globals/Object/Object.mdx | 27 --- .../version-1.6.0/globals/Object/assign.mdx | 57 ----- .../version-1.6.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-1.6.0/globals/Object/entries.mdx | 30 --- .../version-1.6.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-1.6.0/globals/Object/hasOwn.mdx | 46 ---- .../version-1.6.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-1.6.0/globals/Object/isFrozen.mdx | 31 --- .../version-1.6.0/globals/Object/isSealed.mdx | 32 --- .../version-1.6.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-1.6.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-1.6.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-1.6.0/globals/Promise/Promise.mdx | 140 ----------- .../version-1.6.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-1.6.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-1.6.0/globals/Promise/race.mdx | 30 --- .../version-1.6.0/globals/Promise/reject.mdx | 32 --- .../version-1.6.0/globals/Promise/resolve.mdx | 39 --- .../version-1.6.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-1.6.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-1.6.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-1.6.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-1.6.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-1.6.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-1.6.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-1.6.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-1.6.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-1.6.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-1.6.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../version-1.6.0/globals/Set/@@species.mdx | 25 -- .../version-1.6.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-1.6.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-1.6.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 38 --- .../globals/SubtleCrypto/prototype/digest.mdx | 44 ---- .../version-1.6.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-1.6.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-1.6.0/globals/Symbol/iterator.mdx | 26 -- .../version-1.6.0/globals/Symbol/keyFor.mdx | 25 -- .../version-1.6.0/globals/Symbol/match.mdx | 19 -- .../version-1.6.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-1.6.0/globals/Symbol/replace.mdx | 15 -- .../version-1.6.0/globals/Symbol/search.mdx | 15 -- .../version-1.6.0/globals/Symbol/species.mdx | 21 -- .../version-1.6.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-1.6.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-1.6.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-1.6.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-1.6.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-1.6.0/globals/atob.mdx | 37 --- .../version-1.6.0/globals/btoa.mdx | 38 --- .../version-1.6.0/globals/clearInterval.mdx | 35 --- .../version-1.6.0/globals/clearTimeout.mdx | 36 --- .../version-1.6.0/globals/console/debug.mdx | 26 -- .../version-1.6.0/globals/console/error.mdx | 26 -- .../version-1.6.0/globals/console/info.mdx | 26 -- .../version-1.6.0/globals/console/log.mdx | 30 --- .../version-1.6.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-1.6.0/globals/crypto/subtle.mdx | 16 -- .../version-1.6.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-1.6.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-1.6.0/globals/escape.mdx | 34 --- .../version-1.6.0/globals/eval.mdx | 36 --- .../version-1.6.0/globals/fetch.mdx | 62 ----- .../version-1.6.0/globals/globalThis.mdx | 20 -- .../version-1.6.0/globals/isFinite.mdx | 37 --- .../version-1.6.0/globals/isNaN.mdx | 36 --- .../version-1.6.0/globals/location.mdx | 18 -- .../version-1.6.0/globals/parseFloat.mdx | 41 ---- .../version-1.6.0/globals/parseInt.mdx | 68 ------ .../version-1.6.0/globals/setInterval.mdx | 61 ----- .../version-1.6.0/globals/setTimeout.mdx | 61 ----- .../version-1.6.0/globals/structuredClone.mdx | 33 --- .../version-1.6.0/globals/undefined.mdx | 25 -- .../version-1.6.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-1.6.0/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-1.7.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../ObjectStore/ObjectStore.mdx | 62 ----- .../ObjectStore/prototype/get.mdx | 68 ------ .../ObjectStore/prototype/put.mdx | 68 ------ .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-1.7.0/globals/Array/@@species.mdx | 57 ----- .../version-1.7.0/globals/Array/Array.mdx | 41 ---- .../version-1.7.0/globals/Array/from.mdx | 62 ----- .../version-1.7.0/globals/Array/isArray.mdx | 32 --- .../version-1.7.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-1.7.0/globals/BigInt/BigInt.mdx | 37 --- .../version-1.7.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-1.7.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-1.7.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-1.7.0/globals/Date/Date.mdx | 88 ------- .../version-1.7.0/globals/Date/UTC.mdx | 84 ------- .../version-1.7.0/globals/Date/now.mdx | 19 -- .../version-1.7.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-1.7.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-1.7.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-1.7.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-1.7.0/globals/JSON/parse.mdx | 50 ---- .../version-1.7.0/globals/JSON/stringify.mdx | 96 -------- .../version-1.7.0/globals/Map/@@species.mdx | 25 -- .../version-1.7.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-1.7.0/globals/Math/E.mdx | 17 -- .../version-1.7.0/globals/Math/LN10.mdx | 17 -- .../version-1.7.0/globals/Math/LN2.mdx | 17 -- .../version-1.7.0/globals/Math/LOG10e.mdx | 17 -- .../version-1.7.0/globals/Math/LOG2e.mdx | 17 -- .../version-1.7.0/globals/Math/PI.mdx | 17 -- .../version-1.7.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-1.7.0/globals/Math/SQRT2.mdx | 19 -- .../version-1.7.0/globals/Math/abs.mdx | 29 --- .../version-1.7.0/globals/Math/acos.mdx | 28 --- .../version-1.7.0/globals/Math/acosh.mdx | 28 --- .../version-1.7.0/globals/Math/asin.mdx | 28 --- .../version-1.7.0/globals/Math/asinh.mdx | 28 --- .../version-1.7.0/globals/Math/atan.mdx | 28 --- .../version-1.7.0/globals/Math/atan2.mdx | 51 ---- .../version-1.7.0/globals/Math/atanh.mdx | 29 --- .../version-1.7.0/globals/Math/cbrt.mdx | 28 --- .../version-1.7.0/globals/Math/ceil.mdx | 28 --- .../version-1.7.0/globals/Math/clz32.mdx | 34 --- .../version-1.7.0/globals/Math/cos.mdx | 28 --- .../version-1.7.0/globals/Math/cosh.mdx | 28 --- .../version-1.7.0/globals/Math/exp.mdx | 30 --- .../version-1.7.0/globals/Math/expm1.mdx | 32 --- .../version-1.7.0/globals/Math/floor.mdx | 28 --- .../version-1.7.0/globals/Math/fround.mdx | 32 --- .../version-1.7.0/globals/Math/hypot.mdx | 39 --- .../version-1.7.0/globals/Math/imul.mdx | 35 --- .../version-1.7.0/globals/Math/log.mdx | 32 --- .../version-1.7.0/globals/Math/log10.mdx | 30 --- .../version-1.7.0/globals/Math/log1p.mdx | 34 --- .../version-1.7.0/globals/Math/log2.mdx | 30 --- .../version-1.7.0/globals/Math/max.mdx | 33 --- .../version-1.7.0/globals/Math/min.mdx | 33 --- .../version-1.7.0/globals/Math/pow.mdx | 39 --- .../version-1.7.0/globals/Math/random.mdx | 21 -- .../version-1.7.0/globals/Math/round.mdx | 34 --- .../version-1.7.0/globals/Math/sign.mdx | 34 --- .../version-1.7.0/globals/Math/sin.mdx | 28 --- .../version-1.7.0/globals/Math/sinh.mdx | 29 --- .../version-1.7.0/globals/Math/sqrt.mdx | 29 --- .../version-1.7.0/globals/Math/tan.mdx | 31 --- .../version-1.7.0/globals/Math/tanh.mdx | 28 --- .../version-1.7.0/globals/Math/trunc.mdx | 30 --- .../version-1.7.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-1.7.0/globals/Number/NaN.mdx | 17 -- .../version-1.7.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-1.7.0/globals/Number/epsilon.mdx | 21 -- .../version-1.7.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-1.7.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-1.7.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-1.7.0/globals/Object/Object.mdx | 27 --- .../version-1.7.0/globals/Object/assign.mdx | 57 ----- .../version-1.7.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-1.7.0/globals/Object/entries.mdx | 30 --- .../version-1.7.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-1.7.0/globals/Object/hasOwn.mdx | 46 ---- .../version-1.7.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-1.7.0/globals/Object/isFrozen.mdx | 31 --- .../version-1.7.0/globals/Object/isSealed.mdx | 32 --- .../version-1.7.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-1.7.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-1.7.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-1.7.0/globals/Promise/Promise.mdx | 140 ----------- .../version-1.7.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-1.7.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-1.7.0/globals/Promise/race.mdx | 30 --- .../version-1.7.0/globals/Promise/reject.mdx | 32 --- .../version-1.7.0/globals/Promise/resolve.mdx | 39 --- .../version-1.7.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-1.7.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-1.7.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-1.7.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-1.7.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-1.7.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-1.7.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-1.7.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-1.7.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-1.7.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-1.7.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../version-1.7.0/globals/Set/@@species.mdx | 25 -- .../version-1.7.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-1.7.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-1.7.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 38 --- .../globals/SubtleCrypto/prototype/digest.mdx | 44 ---- .../version-1.7.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-1.7.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-1.7.0/globals/Symbol/iterator.mdx | 26 -- .../version-1.7.0/globals/Symbol/keyFor.mdx | 25 -- .../version-1.7.0/globals/Symbol/match.mdx | 19 -- .../version-1.7.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-1.7.0/globals/Symbol/replace.mdx | 15 -- .../version-1.7.0/globals/Symbol/search.mdx | 15 -- .../version-1.7.0/globals/Symbol/species.mdx | 21 -- .../version-1.7.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-1.7.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-1.7.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-1.7.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-1.7.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-1.7.0/globals/atob.mdx | 37 --- .../version-1.7.0/globals/btoa.mdx | 38 --- .../version-1.7.0/globals/clearInterval.mdx | 35 --- .../version-1.7.0/globals/clearTimeout.mdx | 36 --- .../version-1.7.0/globals/console/debug.mdx | 26 -- .../version-1.7.0/globals/console/error.mdx | 26 -- .../version-1.7.0/globals/console/info.mdx | 26 -- .../version-1.7.0/globals/console/log.mdx | 30 --- .../version-1.7.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-1.7.0/globals/crypto/subtle.mdx | 16 -- .../version-1.7.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-1.7.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-1.7.0/globals/escape.mdx | 34 --- .../version-1.7.0/globals/eval.mdx | 36 --- .../version-1.7.0/globals/fetch.mdx | 62 ----- .../version-1.7.0/globals/globalThis.mdx | 20 -- .../version-1.7.0/globals/isFinite.mdx | 37 --- .../version-1.7.0/globals/isNaN.mdx | 36 --- .../version-1.7.0/globals/location.mdx | 18 -- .../version-1.7.0/globals/parseFloat.mdx | 41 ---- .../version-1.7.0/globals/parseInt.mdx | 68 ------ .../version-1.7.0/globals/setInterval.mdx | 61 ----- .../version-1.7.0/globals/setTimeout.mdx | 61 ----- .../version-1.7.0/globals/structuredClone.mdx | 33 --- .../version-1.7.0/globals/undefined.mdx | 25 -- .../version-1.7.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-1.7.0/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-1.8.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../ObjectStore/ObjectStore.mdx | 62 ----- .../ObjectStore/prototype/get.mdx | 68 ------ .../ObjectStore/prototype/put.mdx | 68 ------ .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-1.8.0/globals/Array/@@species.mdx | 57 ----- .../version-1.8.0/globals/Array/Array.mdx | 41 ---- .../version-1.8.0/globals/Array/from.mdx | 62 ----- .../version-1.8.0/globals/Array/isArray.mdx | 32 --- .../version-1.8.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-1.8.0/globals/BigInt/BigInt.mdx | 37 --- .../version-1.8.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-1.8.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-1.8.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-1.8.0/globals/Date/Date.mdx | 88 ------- .../version-1.8.0/globals/Date/UTC.mdx | 84 ------- .../version-1.8.0/globals/Date/now.mdx | 19 -- .../version-1.8.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-1.8.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-1.8.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-1.8.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-1.8.0/globals/JSON/parse.mdx | 50 ---- .../version-1.8.0/globals/JSON/stringify.mdx | 96 -------- .../version-1.8.0/globals/Map/@@species.mdx | 25 -- .../version-1.8.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-1.8.0/globals/Math/E.mdx | 17 -- .../version-1.8.0/globals/Math/LN10.mdx | 17 -- .../version-1.8.0/globals/Math/LN2.mdx | 17 -- .../version-1.8.0/globals/Math/LOG10e.mdx | 17 -- .../version-1.8.0/globals/Math/LOG2e.mdx | 17 -- .../version-1.8.0/globals/Math/PI.mdx | 17 -- .../version-1.8.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-1.8.0/globals/Math/SQRT2.mdx | 19 -- .../version-1.8.0/globals/Math/abs.mdx | 29 --- .../version-1.8.0/globals/Math/acos.mdx | 28 --- .../version-1.8.0/globals/Math/acosh.mdx | 28 --- .../version-1.8.0/globals/Math/asin.mdx | 28 --- .../version-1.8.0/globals/Math/asinh.mdx | 28 --- .../version-1.8.0/globals/Math/atan.mdx | 28 --- .../version-1.8.0/globals/Math/atan2.mdx | 51 ---- .../version-1.8.0/globals/Math/atanh.mdx | 29 --- .../version-1.8.0/globals/Math/cbrt.mdx | 28 --- .../version-1.8.0/globals/Math/ceil.mdx | 28 --- .../version-1.8.0/globals/Math/clz32.mdx | 34 --- .../version-1.8.0/globals/Math/cos.mdx | 28 --- .../version-1.8.0/globals/Math/cosh.mdx | 28 --- .../version-1.8.0/globals/Math/exp.mdx | 30 --- .../version-1.8.0/globals/Math/expm1.mdx | 32 --- .../version-1.8.0/globals/Math/floor.mdx | 28 --- .../version-1.8.0/globals/Math/fround.mdx | 32 --- .../version-1.8.0/globals/Math/hypot.mdx | 39 --- .../version-1.8.0/globals/Math/imul.mdx | 35 --- .../version-1.8.0/globals/Math/log.mdx | 32 --- .../version-1.8.0/globals/Math/log10.mdx | 30 --- .../version-1.8.0/globals/Math/log1p.mdx | 34 --- .../version-1.8.0/globals/Math/log2.mdx | 30 --- .../version-1.8.0/globals/Math/max.mdx | 33 --- .../version-1.8.0/globals/Math/min.mdx | 33 --- .../version-1.8.0/globals/Math/pow.mdx | 39 --- .../version-1.8.0/globals/Math/random.mdx | 21 -- .../version-1.8.0/globals/Math/round.mdx | 34 --- .../version-1.8.0/globals/Math/sign.mdx | 34 --- .../version-1.8.0/globals/Math/sin.mdx | 28 --- .../version-1.8.0/globals/Math/sinh.mdx | 29 --- .../version-1.8.0/globals/Math/sqrt.mdx | 29 --- .../version-1.8.0/globals/Math/tan.mdx | 31 --- .../version-1.8.0/globals/Math/tanh.mdx | 28 --- .../version-1.8.0/globals/Math/trunc.mdx | 30 --- .../version-1.8.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-1.8.0/globals/Number/NaN.mdx | 17 -- .../version-1.8.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-1.8.0/globals/Number/epsilon.mdx | 21 -- .../version-1.8.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-1.8.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-1.8.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-1.8.0/globals/Object/Object.mdx | 27 --- .../version-1.8.0/globals/Object/assign.mdx | 57 ----- .../version-1.8.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-1.8.0/globals/Object/entries.mdx | 30 --- .../version-1.8.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-1.8.0/globals/Object/hasOwn.mdx | 46 ---- .../version-1.8.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-1.8.0/globals/Object/isFrozen.mdx | 31 --- .../version-1.8.0/globals/Object/isSealed.mdx | 32 --- .../version-1.8.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-1.8.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-1.8.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-1.8.0/globals/Promise/Promise.mdx | 140 ----------- .../version-1.8.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-1.8.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-1.8.0/globals/Promise/race.mdx | 30 --- .../version-1.8.0/globals/Promise/reject.mdx | 32 --- .../version-1.8.0/globals/Promise/resolve.mdx | 39 --- .../version-1.8.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-1.8.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-1.8.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-1.8.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-1.8.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-1.8.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-1.8.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-1.8.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-1.8.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-1.8.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-1.8.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../version-1.8.0/globals/Set/@@species.mdx | 25 -- .../version-1.8.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-1.8.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-1.8.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 38 --- .../globals/SubtleCrypto/prototype/digest.mdx | 44 ---- .../version-1.8.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-1.8.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-1.8.0/globals/Symbol/iterator.mdx | 26 -- .../version-1.8.0/globals/Symbol/keyFor.mdx | 25 -- .../version-1.8.0/globals/Symbol/match.mdx | 19 -- .../version-1.8.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-1.8.0/globals/Symbol/replace.mdx | 15 -- .../version-1.8.0/globals/Symbol/search.mdx | 15 -- .../version-1.8.0/globals/Symbol/species.mdx | 21 -- .../version-1.8.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-1.8.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-1.8.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-1.8.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-1.8.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-1.8.0/globals/atob.mdx | 37 --- .../version-1.8.0/globals/btoa.mdx | 38 --- .../version-1.8.0/globals/clearInterval.mdx | 35 --- .../version-1.8.0/globals/clearTimeout.mdx | 36 --- .../version-1.8.0/globals/console/debug.mdx | 26 -- .../version-1.8.0/globals/console/error.mdx | 26 -- .../version-1.8.0/globals/console/info.mdx | 26 -- .../version-1.8.0/globals/console/log.mdx | 30 --- .../version-1.8.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-1.8.0/globals/crypto/subtle.mdx | 16 -- .../version-1.8.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-1.8.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-1.8.0/globals/escape.mdx | 34 --- .../version-1.8.0/globals/eval.mdx | 36 --- .../version-1.8.0/globals/fetch.mdx | 62 ----- .../version-1.8.0/globals/globalThis.mdx | 20 -- .../version-1.8.0/globals/isFinite.mdx | 37 --- .../version-1.8.0/globals/isNaN.mdx | 36 --- .../version-1.8.0/globals/location.mdx | 18 -- .../version-1.8.0/globals/parseFloat.mdx | 41 ---- .../version-1.8.0/globals/parseInt.mdx | 68 ------ .../version-1.8.0/globals/setInterval.mdx | 61 ----- .../version-1.8.0/globals/setTimeout.mdx | 61 ----- .../version-1.8.0/globals/structuredClone.mdx | 33 --- .../version-1.8.0/globals/undefined.mdx | 25 -- .../version-1.8.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-1.8.0/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-1.9.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../ObjectStore/ObjectStore.mdx | 62 ----- .../ObjectStore/prototype/get.mdx | 68 ------ .../ObjectStore/prototype/put.mdx | 68 ------ .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-1.9.0/globals/Array/@@species.mdx | 57 ----- .../version-1.9.0/globals/Array/Array.mdx | 41 ---- .../version-1.9.0/globals/Array/from.mdx | 62 ----- .../version-1.9.0/globals/Array/isArray.mdx | 32 --- .../version-1.9.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-1.9.0/globals/BigInt/BigInt.mdx | 37 --- .../version-1.9.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-1.9.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-1.9.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-1.9.0/globals/Date/Date.mdx | 88 ------- .../version-1.9.0/globals/Date/UTC.mdx | 84 ------- .../version-1.9.0/globals/Date/now.mdx | 19 -- .../version-1.9.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-1.9.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-1.9.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-1.9.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-1.9.0/globals/JSON/parse.mdx | 50 ---- .../version-1.9.0/globals/JSON/stringify.mdx | 96 -------- .../version-1.9.0/globals/Map/@@species.mdx | 25 -- .../version-1.9.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-1.9.0/globals/Math/E.mdx | 17 -- .../version-1.9.0/globals/Math/LN10.mdx | 17 -- .../version-1.9.0/globals/Math/LN2.mdx | 17 -- .../version-1.9.0/globals/Math/LOG10e.mdx | 17 -- .../version-1.9.0/globals/Math/LOG2e.mdx | 17 -- .../version-1.9.0/globals/Math/PI.mdx | 17 -- .../version-1.9.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-1.9.0/globals/Math/SQRT2.mdx | 19 -- .../version-1.9.0/globals/Math/abs.mdx | 29 --- .../version-1.9.0/globals/Math/acos.mdx | 28 --- .../version-1.9.0/globals/Math/acosh.mdx | 28 --- .../version-1.9.0/globals/Math/asin.mdx | 28 --- .../version-1.9.0/globals/Math/asinh.mdx | 28 --- .../version-1.9.0/globals/Math/atan.mdx | 28 --- .../version-1.9.0/globals/Math/atan2.mdx | 51 ---- .../version-1.9.0/globals/Math/atanh.mdx | 29 --- .../version-1.9.0/globals/Math/cbrt.mdx | 28 --- .../version-1.9.0/globals/Math/ceil.mdx | 28 --- .../version-1.9.0/globals/Math/clz32.mdx | 34 --- .../version-1.9.0/globals/Math/cos.mdx | 28 --- .../version-1.9.0/globals/Math/cosh.mdx | 28 --- .../version-1.9.0/globals/Math/exp.mdx | 30 --- .../version-1.9.0/globals/Math/expm1.mdx | 32 --- .../version-1.9.0/globals/Math/floor.mdx | 28 --- .../version-1.9.0/globals/Math/fround.mdx | 32 --- .../version-1.9.0/globals/Math/hypot.mdx | 39 --- .../version-1.9.0/globals/Math/imul.mdx | 35 --- .../version-1.9.0/globals/Math/log.mdx | 32 --- .../version-1.9.0/globals/Math/log10.mdx | 30 --- .../version-1.9.0/globals/Math/log1p.mdx | 34 --- .../version-1.9.0/globals/Math/log2.mdx | 30 --- .../version-1.9.0/globals/Math/max.mdx | 33 --- .../version-1.9.0/globals/Math/min.mdx | 33 --- .../version-1.9.0/globals/Math/pow.mdx | 39 --- .../version-1.9.0/globals/Math/random.mdx | 21 -- .../version-1.9.0/globals/Math/round.mdx | 34 --- .../version-1.9.0/globals/Math/sign.mdx | 34 --- .../version-1.9.0/globals/Math/sin.mdx | 28 --- .../version-1.9.0/globals/Math/sinh.mdx | 29 --- .../version-1.9.0/globals/Math/sqrt.mdx | 29 --- .../version-1.9.0/globals/Math/tan.mdx | 31 --- .../version-1.9.0/globals/Math/tanh.mdx | 28 --- .../version-1.9.0/globals/Math/trunc.mdx | 30 --- .../version-1.9.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-1.9.0/globals/Number/NaN.mdx | 17 -- .../version-1.9.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-1.9.0/globals/Number/epsilon.mdx | 21 -- .../version-1.9.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-1.9.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-1.9.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-1.9.0/globals/Object/Object.mdx | 27 --- .../version-1.9.0/globals/Object/assign.mdx | 57 ----- .../version-1.9.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-1.9.0/globals/Object/entries.mdx | 30 --- .../version-1.9.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-1.9.0/globals/Object/hasOwn.mdx | 46 ---- .../version-1.9.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-1.9.0/globals/Object/isFrozen.mdx | 31 --- .../version-1.9.0/globals/Object/isSealed.mdx | 32 --- .../version-1.9.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-1.9.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-1.9.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-1.9.0/globals/Promise/Promise.mdx | 140 ----------- .../version-1.9.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-1.9.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-1.9.0/globals/Promise/race.mdx | 30 --- .../version-1.9.0/globals/Promise/reject.mdx | 32 --- .../version-1.9.0/globals/Promise/resolve.mdx | 39 --- .../version-1.9.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-1.9.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-1.9.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-1.9.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-1.9.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-1.9.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-1.9.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-1.9.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-1.9.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-1.9.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-1.9.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../RsaHashedImportParams.mdx | 19 -- .../version-1.9.0/globals/Set/@@species.mdx | 25 -- .../version-1.9.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-1.9.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-1.9.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 44 ---- .../SubtleCrypto/prototype/importKey.mdx | 87 ------- .../globals/SubtleCrypto/prototype/sign.mdx | 51 ---- .../globals/SubtleCrypto/prototype/verify.mdx | 51 ---- .../version-1.9.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-1.9.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-1.9.0/globals/Symbol/iterator.mdx | 26 -- .../version-1.9.0/globals/Symbol/keyFor.mdx | 25 -- .../version-1.9.0/globals/Symbol/match.mdx | 19 -- .../version-1.9.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-1.9.0/globals/Symbol/replace.mdx | 15 -- .../version-1.9.0/globals/Symbol/search.mdx | 15 -- .../version-1.9.0/globals/Symbol/species.mdx | 21 -- .../version-1.9.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-1.9.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-1.9.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-1.9.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-1.9.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-1.9.0/globals/atob.mdx | 37 --- .../version-1.9.0/globals/btoa.mdx | 38 --- .../version-1.9.0/globals/clearInterval.mdx | 35 --- .../version-1.9.0/globals/clearTimeout.mdx | 36 --- .../version-1.9.0/globals/console/debug.mdx | 26 -- .../version-1.9.0/globals/console/error.mdx | 26 -- .../version-1.9.0/globals/console/info.mdx | 26 -- .../version-1.9.0/globals/console/log.mdx | 30 --- .../version-1.9.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-1.9.0/globals/crypto/subtle.mdx | 16 -- .../version-1.9.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-1.9.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-1.9.0/globals/escape.mdx | 34 --- .../version-1.9.0/globals/eval.mdx | 36 --- .../version-1.9.0/globals/fetch.mdx | 62 ----- .../version-1.9.0/globals/globalThis.mdx | 20 -- .../version-1.9.0/globals/isFinite.mdx | 37 --- .../version-1.9.0/globals/isNaN.mdx | 36 --- .../version-1.9.0/globals/location.mdx | 18 -- .../version-1.9.0/globals/parseFloat.mdx | 41 ---- .../version-1.9.0/globals/parseInt.mdx | 68 ------ .../version-1.9.0/globals/setInterval.mdx | 61 ----- .../version-1.9.0/globals/setTimeout.mdx | 61 ----- .../version-1.9.0/globals/structuredClone.mdx | 33 --- .../version-1.9.0/globals/undefined.mdx | 25 -- .../version-1.9.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-1.9.0/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-2.0.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-2.0.0/globals/Array/@@species.mdx | 57 ----- .../version-2.0.0/globals/Array/Array.mdx | 41 ---- .../version-2.0.0/globals/Array/from.mdx | 62 ----- .../version-2.0.0/globals/Array/isArray.mdx | 32 --- .../version-2.0.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-2.0.0/globals/BigInt/BigInt.mdx | 37 --- .../version-2.0.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-2.0.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-2.0.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-2.0.0/globals/Date/Date.mdx | 88 ------- .../version-2.0.0/globals/Date/UTC.mdx | 84 ------- .../version-2.0.0/globals/Date/now.mdx | 19 -- .../version-2.0.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-2.0.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-2.0.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-2.0.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-2.0.0/globals/JSON/parse.mdx | 50 ---- .../version-2.0.0/globals/JSON/stringify.mdx | 96 -------- .../version-2.0.0/globals/Map/@@species.mdx | 25 -- .../version-2.0.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-2.0.0/globals/Math/E.mdx | 17 -- .../version-2.0.0/globals/Math/LN10.mdx | 17 -- .../version-2.0.0/globals/Math/LN2.mdx | 17 -- .../version-2.0.0/globals/Math/LOG10e.mdx | 17 -- .../version-2.0.0/globals/Math/LOG2e.mdx | 17 -- .../version-2.0.0/globals/Math/PI.mdx | 17 -- .../version-2.0.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-2.0.0/globals/Math/SQRT2.mdx | 19 -- .../version-2.0.0/globals/Math/abs.mdx | 29 --- .../version-2.0.0/globals/Math/acos.mdx | 28 --- .../version-2.0.0/globals/Math/acosh.mdx | 28 --- .../version-2.0.0/globals/Math/asin.mdx | 28 --- .../version-2.0.0/globals/Math/asinh.mdx | 28 --- .../version-2.0.0/globals/Math/atan.mdx | 28 --- .../version-2.0.0/globals/Math/atan2.mdx | 51 ---- .../version-2.0.0/globals/Math/atanh.mdx | 29 --- .../version-2.0.0/globals/Math/cbrt.mdx | 28 --- .../version-2.0.0/globals/Math/ceil.mdx | 28 --- .../version-2.0.0/globals/Math/clz32.mdx | 34 --- .../version-2.0.0/globals/Math/cos.mdx | 28 --- .../version-2.0.0/globals/Math/cosh.mdx | 28 --- .../version-2.0.0/globals/Math/exp.mdx | 30 --- .../version-2.0.0/globals/Math/expm1.mdx | 32 --- .../version-2.0.0/globals/Math/floor.mdx | 28 --- .../version-2.0.0/globals/Math/fround.mdx | 32 --- .../version-2.0.0/globals/Math/hypot.mdx | 39 --- .../version-2.0.0/globals/Math/imul.mdx | 35 --- .../version-2.0.0/globals/Math/log.mdx | 32 --- .../version-2.0.0/globals/Math/log10.mdx | 30 --- .../version-2.0.0/globals/Math/log1p.mdx | 34 --- .../version-2.0.0/globals/Math/log2.mdx | 30 --- .../version-2.0.0/globals/Math/max.mdx | 33 --- .../version-2.0.0/globals/Math/min.mdx | 33 --- .../version-2.0.0/globals/Math/pow.mdx | 39 --- .../version-2.0.0/globals/Math/random.mdx | 21 -- .../version-2.0.0/globals/Math/round.mdx | 34 --- .../version-2.0.0/globals/Math/sign.mdx | 34 --- .../version-2.0.0/globals/Math/sin.mdx | 28 --- .../version-2.0.0/globals/Math/sinh.mdx | 29 --- .../version-2.0.0/globals/Math/sqrt.mdx | 29 --- .../version-2.0.0/globals/Math/tan.mdx | 31 --- .../version-2.0.0/globals/Math/tanh.mdx | 28 --- .../version-2.0.0/globals/Math/trunc.mdx | 30 --- .../version-2.0.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-2.0.0/globals/Number/NaN.mdx | 17 -- .../version-2.0.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-2.0.0/globals/Number/epsilon.mdx | 21 -- .../version-2.0.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-2.0.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-2.0.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-2.0.0/globals/Object/Object.mdx | 27 --- .../version-2.0.0/globals/Object/assign.mdx | 57 ----- .../version-2.0.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-2.0.0/globals/Object/entries.mdx | 30 --- .../version-2.0.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-2.0.0/globals/Object/hasOwn.mdx | 46 ---- .../version-2.0.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-2.0.0/globals/Object/isFrozen.mdx | 31 --- .../version-2.0.0/globals/Object/isSealed.mdx | 32 --- .../version-2.0.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-2.0.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-2.0.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-2.0.0/globals/Promise/Promise.mdx | 140 ----------- .../version-2.0.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-2.0.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-2.0.0/globals/Promise/race.mdx | 30 --- .../version-2.0.0/globals/Promise/reject.mdx | 32 --- .../version-2.0.0/globals/Promise/resolve.mdx | 39 --- .../version-2.0.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-2.0.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-2.0.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-2.0.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-2.0.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-2.0.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-2.0.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-2.0.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-2.0.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-2.0.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-2.0.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 19 -- .../version-2.0.0/globals/Set/@@species.mdx | 25 -- .../version-2.0.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-2.0.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-2.0.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 87 ------- .../globals/SubtleCrypto/prototype/sign.mdx | 51 ---- .../globals/SubtleCrypto/prototype/verify.mdx | 51 ---- .../version-2.0.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-2.0.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-2.0.0/globals/Symbol/iterator.mdx | 26 -- .../version-2.0.0/globals/Symbol/keyFor.mdx | 25 -- .../version-2.0.0/globals/Symbol/match.mdx | 19 -- .../version-2.0.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-2.0.0/globals/Symbol/replace.mdx | 15 -- .../version-2.0.0/globals/Symbol/search.mdx | 15 -- .../version-2.0.0/globals/Symbol/species.mdx | 21 -- .../version-2.0.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-2.0.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-2.0.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-2.0.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-2.0.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-2.0.0/globals/atob.mdx | 37 --- .../version-2.0.0/globals/btoa.mdx | 38 --- .../version-2.0.0/globals/clearInterval.mdx | 35 --- .../version-2.0.0/globals/clearTimeout.mdx | 36 --- .../version-2.0.0/globals/console/count.mdx | 30 --- .../version-2.0.0/globals/console/debug.mdx | 26 -- .../version-2.0.0/globals/console/error.mdx | 26 -- .../version-2.0.0/globals/console/info.mdx | 26 -- .../version-2.0.0/globals/console/log.mdx | 30 --- .../version-2.0.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-2.0.0/globals/crypto/subtle.mdx | 16 -- .../version-2.0.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-2.0.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-2.0.0/globals/escape.mdx | 34 --- .../version-2.0.0/globals/eval.mdx | 36 --- .../version-2.0.0/globals/fetch.mdx | 62 ----- .../version-2.0.0/globals/globalThis.mdx | 20 -- .../version-2.0.0/globals/isFinite.mdx | 37 --- .../version-2.0.0/globals/isNaN.mdx | 36 --- .../version-2.0.0/globals/location.mdx | 18 -- .../version-2.0.0/globals/parseFloat.mdx | 41 ---- .../version-2.0.0/globals/parseInt.mdx | 68 ------ .../version-2.0.0/globals/setInterval.mdx | 61 ----- .../version-2.0.0/globals/setTimeout.mdx | 61 ----- .../version-2.0.0/globals/structuredClone.mdx | 33 --- .../version-2.0.0/globals/undefined.mdx | 25 -- .../version-2.0.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-2.0.0/index.mdx | 98 -------- .../version-2.0.0/migration-guide/index.mdx | 48 ---- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 46 ---- .../fastly:cache/SimpleCache/delete.mdx | 74 ------ .../fastly:cache/SimpleCache/get.mdx | 70 ------ .../fastly:cache/SimpleCache/set.mdx | 77 ------ .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-2.1.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-2.1.0/globals/Array/@@species.mdx | 57 ----- .../version-2.1.0/globals/Array/Array.mdx | 41 ---- .../version-2.1.0/globals/Array/from.mdx | 62 ----- .../version-2.1.0/globals/Array/isArray.mdx | 32 --- .../version-2.1.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-2.1.0/globals/BigInt/BigInt.mdx | 37 --- .../version-2.1.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-2.1.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-2.1.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-2.1.0/globals/Date/Date.mdx | 88 ------- .../version-2.1.0/globals/Date/UTC.mdx | 84 ------- .../version-2.1.0/globals/Date/now.mdx | 19 -- .../version-2.1.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-2.1.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-2.1.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-2.1.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-2.1.0/globals/JSON/parse.mdx | 50 ---- .../version-2.1.0/globals/JSON/stringify.mdx | 96 -------- .../version-2.1.0/globals/Map/@@species.mdx | 25 -- .../version-2.1.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-2.1.0/globals/Math/E.mdx | 17 -- .../version-2.1.0/globals/Math/LN10.mdx | 17 -- .../version-2.1.0/globals/Math/LN2.mdx | 17 -- .../version-2.1.0/globals/Math/LOG10e.mdx | 17 -- .../version-2.1.0/globals/Math/LOG2e.mdx | 17 -- .../version-2.1.0/globals/Math/PI.mdx | 17 -- .../version-2.1.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-2.1.0/globals/Math/SQRT2.mdx | 19 -- .../version-2.1.0/globals/Math/abs.mdx | 29 --- .../version-2.1.0/globals/Math/acos.mdx | 28 --- .../version-2.1.0/globals/Math/acosh.mdx | 28 --- .../version-2.1.0/globals/Math/asin.mdx | 28 --- .../version-2.1.0/globals/Math/asinh.mdx | 28 --- .../version-2.1.0/globals/Math/atan.mdx | 28 --- .../version-2.1.0/globals/Math/atan2.mdx | 51 ---- .../version-2.1.0/globals/Math/atanh.mdx | 29 --- .../version-2.1.0/globals/Math/cbrt.mdx | 28 --- .../version-2.1.0/globals/Math/ceil.mdx | 28 --- .../version-2.1.0/globals/Math/clz32.mdx | 34 --- .../version-2.1.0/globals/Math/cos.mdx | 28 --- .../version-2.1.0/globals/Math/cosh.mdx | 28 --- .../version-2.1.0/globals/Math/exp.mdx | 30 --- .../version-2.1.0/globals/Math/expm1.mdx | 32 --- .../version-2.1.0/globals/Math/floor.mdx | 28 --- .../version-2.1.0/globals/Math/fround.mdx | 32 --- .../version-2.1.0/globals/Math/hypot.mdx | 39 --- .../version-2.1.0/globals/Math/imul.mdx | 35 --- .../version-2.1.0/globals/Math/log.mdx | 32 --- .../version-2.1.0/globals/Math/log10.mdx | 30 --- .../version-2.1.0/globals/Math/log1p.mdx | 34 --- .../version-2.1.0/globals/Math/log2.mdx | 30 --- .../version-2.1.0/globals/Math/max.mdx | 33 --- .../version-2.1.0/globals/Math/min.mdx | 33 --- .../version-2.1.0/globals/Math/pow.mdx | 39 --- .../version-2.1.0/globals/Math/random.mdx | 21 -- .../version-2.1.0/globals/Math/round.mdx | 34 --- .../version-2.1.0/globals/Math/sign.mdx | 34 --- .../version-2.1.0/globals/Math/sin.mdx | 28 --- .../version-2.1.0/globals/Math/sinh.mdx | 29 --- .../version-2.1.0/globals/Math/sqrt.mdx | 29 --- .../version-2.1.0/globals/Math/tan.mdx | 31 --- .../version-2.1.0/globals/Math/tanh.mdx | 28 --- .../version-2.1.0/globals/Math/trunc.mdx | 30 --- .../version-2.1.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-2.1.0/globals/Number/NaN.mdx | 17 -- .../version-2.1.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-2.1.0/globals/Number/epsilon.mdx | 21 -- .../version-2.1.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-2.1.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-2.1.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-2.1.0/globals/Object/Object.mdx | 27 --- .../version-2.1.0/globals/Object/assign.mdx | 57 ----- .../version-2.1.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-2.1.0/globals/Object/entries.mdx | 30 --- .../version-2.1.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-2.1.0/globals/Object/hasOwn.mdx | 46 ---- .../version-2.1.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-2.1.0/globals/Object/isFrozen.mdx | 31 --- .../version-2.1.0/globals/Object/isSealed.mdx | 32 --- .../version-2.1.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-2.1.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-2.1.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-2.1.0/globals/Promise/Promise.mdx | 140 ----------- .../version-2.1.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-2.1.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-2.1.0/globals/Promise/race.mdx | 30 --- .../version-2.1.0/globals/Promise/reject.mdx | 32 --- .../version-2.1.0/globals/Promise/resolve.mdx | 39 --- .../version-2.1.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-2.1.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-2.1.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-2.1.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-2.1.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-2.1.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-2.1.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-2.1.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-2.1.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-2.1.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-2.1.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 19 -- .../version-2.1.0/globals/Set/@@species.mdx | 25 -- .../version-2.1.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-2.1.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-2.1.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 87 ------- .../globals/SubtleCrypto/prototype/sign.mdx | 51 ---- .../globals/SubtleCrypto/prototype/verify.mdx | 51 ---- .../version-2.1.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-2.1.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-2.1.0/globals/Symbol/iterator.mdx | 26 -- .../version-2.1.0/globals/Symbol/keyFor.mdx | 25 -- .../version-2.1.0/globals/Symbol/match.mdx | 19 -- .../version-2.1.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-2.1.0/globals/Symbol/replace.mdx | 15 -- .../version-2.1.0/globals/Symbol/search.mdx | 15 -- .../version-2.1.0/globals/Symbol/species.mdx | 21 -- .../version-2.1.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-2.1.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-2.1.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-2.1.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-2.1.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-2.1.0/globals/atob.mdx | 37 --- .../version-2.1.0/globals/btoa.mdx | 38 --- .../version-2.1.0/globals/clearInterval.mdx | 35 --- .../version-2.1.0/globals/clearTimeout.mdx | 36 --- .../version-2.1.0/globals/console/assert.mdx | 42 ---- .../version-2.1.0/globals/console/clear.mdx | 24 -- .../version-2.1.0/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-2.1.0/globals/console/debug.mdx | 26 -- .../version-2.1.0/globals/console/dir.mdx | 26 -- .../version-2.1.0/globals/console/dirxml.mdx | 25 -- .../version-2.1.0/globals/console/error.mdx | 26 -- .../version-2.1.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-2.1.0/globals/console/info.mdx | 26 -- .../version-2.1.0/globals/console/log.mdx | 30 --- .../version-2.1.0/globals/console/time.mdx | 29 --- .../version-2.1.0/globals/console/timeEnd.mdx | 26 -- .../version-2.1.0/globals/console/timeLog.mdx | 26 -- .../version-2.1.0/globals/console/trace.mdx | 27 --- .../version-2.1.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-2.1.0/globals/crypto/subtle.mdx | 16 -- .../version-2.1.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-2.1.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-2.1.0/globals/escape.mdx | 34 --- .../version-2.1.0/globals/eval.mdx | 36 --- .../version-2.1.0/globals/fetch.mdx | 62 ----- .../version-2.1.0/globals/globalThis.mdx | 20 -- .../version-2.1.0/globals/isFinite.mdx | 37 --- .../version-2.1.0/globals/isNaN.mdx | 36 --- .../version-2.1.0/globals/location.mdx | 18 -- .../version-2.1.0/globals/parseFloat.mdx | 41 ---- .../version-2.1.0/globals/parseInt.mdx | 68 ------ .../version-2.1.0/globals/setInterval.mdx | 61 ----- .../version-2.1.0/globals/setTimeout.mdx | 61 ----- .../version-2.1.0/globals/structuredClone.mdx | 33 --- .../version-2.1.0/globals/undefined.mdx | 25 -- .../version-2.1.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-2.1.0/index.mdx | 98 -------- .../version-2.1.0/migration-guide/index.mdx | 48 ---- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/delete.mdx | 74 ------ .../fastly:cache/SimpleCache/get.mdx | 70 ------ .../fastly:cache/SimpleCache/getOrSet.mdx | 81 ------- .../fastly:cache/SimpleCache/set.mdx | 77 ------ .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-2.2.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-2.2.0/globals/Array/@@species.mdx | 57 ----- .../version-2.2.0/globals/Array/Array.mdx | 41 ---- .../version-2.2.0/globals/Array/from.mdx | 62 ----- .../version-2.2.0/globals/Array/isArray.mdx | 32 --- .../version-2.2.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-2.2.0/globals/BigInt/BigInt.mdx | 37 --- .../version-2.2.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-2.2.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-2.2.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-2.2.0/globals/Date/Date.mdx | 88 ------- .../version-2.2.0/globals/Date/UTC.mdx | 84 ------- .../version-2.2.0/globals/Date/now.mdx | 19 -- .../version-2.2.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-2.2.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-2.2.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-2.2.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-2.2.0/globals/JSON/parse.mdx | 50 ---- .../version-2.2.0/globals/JSON/stringify.mdx | 96 -------- .../version-2.2.0/globals/Map/@@species.mdx | 25 -- .../version-2.2.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-2.2.0/globals/Math/E.mdx | 17 -- .../version-2.2.0/globals/Math/LN10.mdx | 17 -- .../version-2.2.0/globals/Math/LN2.mdx | 17 -- .../version-2.2.0/globals/Math/LOG10e.mdx | 17 -- .../version-2.2.0/globals/Math/LOG2e.mdx | 17 -- .../version-2.2.0/globals/Math/PI.mdx | 17 -- .../version-2.2.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-2.2.0/globals/Math/SQRT2.mdx | 19 -- .../version-2.2.0/globals/Math/abs.mdx | 29 --- .../version-2.2.0/globals/Math/acos.mdx | 28 --- .../version-2.2.0/globals/Math/acosh.mdx | 28 --- .../version-2.2.0/globals/Math/asin.mdx | 28 --- .../version-2.2.0/globals/Math/asinh.mdx | 28 --- .../version-2.2.0/globals/Math/atan.mdx | 28 --- .../version-2.2.0/globals/Math/atan2.mdx | 51 ---- .../version-2.2.0/globals/Math/atanh.mdx | 29 --- .../version-2.2.0/globals/Math/cbrt.mdx | 28 --- .../version-2.2.0/globals/Math/ceil.mdx | 28 --- .../version-2.2.0/globals/Math/clz32.mdx | 34 --- .../version-2.2.0/globals/Math/cos.mdx | 28 --- .../version-2.2.0/globals/Math/cosh.mdx | 28 --- .../version-2.2.0/globals/Math/exp.mdx | 30 --- .../version-2.2.0/globals/Math/expm1.mdx | 32 --- .../version-2.2.0/globals/Math/floor.mdx | 28 --- .../version-2.2.0/globals/Math/fround.mdx | 32 --- .../version-2.2.0/globals/Math/hypot.mdx | 39 --- .../version-2.2.0/globals/Math/imul.mdx | 35 --- .../version-2.2.0/globals/Math/log.mdx | 32 --- .../version-2.2.0/globals/Math/log10.mdx | 30 --- .../version-2.2.0/globals/Math/log1p.mdx | 34 --- .../version-2.2.0/globals/Math/log2.mdx | 30 --- .../version-2.2.0/globals/Math/max.mdx | 33 --- .../version-2.2.0/globals/Math/min.mdx | 33 --- .../version-2.2.0/globals/Math/pow.mdx | 39 --- .../version-2.2.0/globals/Math/random.mdx | 21 -- .../version-2.2.0/globals/Math/round.mdx | 34 --- .../version-2.2.0/globals/Math/sign.mdx | 34 --- .../version-2.2.0/globals/Math/sin.mdx | 28 --- .../version-2.2.0/globals/Math/sinh.mdx | 29 --- .../version-2.2.0/globals/Math/sqrt.mdx | 29 --- .../version-2.2.0/globals/Math/tan.mdx | 31 --- .../version-2.2.0/globals/Math/tanh.mdx | 28 --- .../version-2.2.0/globals/Math/trunc.mdx | 30 --- .../version-2.2.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-2.2.0/globals/Number/NaN.mdx | 17 -- .../version-2.2.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-2.2.0/globals/Number/epsilon.mdx | 21 -- .../version-2.2.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-2.2.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-2.2.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-2.2.0/globals/Object/Object.mdx | 27 --- .../version-2.2.0/globals/Object/assign.mdx | 57 ----- .../version-2.2.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-2.2.0/globals/Object/entries.mdx | 30 --- .../version-2.2.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-2.2.0/globals/Object/hasOwn.mdx | 46 ---- .../version-2.2.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-2.2.0/globals/Object/isFrozen.mdx | 31 --- .../version-2.2.0/globals/Object/isSealed.mdx | 32 --- .../version-2.2.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-2.2.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-2.2.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-2.2.0/globals/Promise/Promise.mdx | 140 ----------- .../version-2.2.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-2.2.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-2.2.0/globals/Promise/race.mdx | 30 --- .../version-2.2.0/globals/Promise/reject.mdx | 32 --- .../version-2.2.0/globals/Promise/resolve.mdx | 39 --- .../version-2.2.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-2.2.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-2.2.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-2.2.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-2.2.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-2.2.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-2.2.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-2.2.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-2.2.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-2.2.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-2.2.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 19 -- .../version-2.2.0/globals/Set/@@species.mdx | 25 -- .../version-2.2.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-2.2.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-2.2.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 87 ------- .../globals/SubtleCrypto/prototype/sign.mdx | 51 ---- .../globals/SubtleCrypto/prototype/verify.mdx | 51 ---- .../version-2.2.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-2.2.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-2.2.0/globals/Symbol/iterator.mdx | 26 -- .../version-2.2.0/globals/Symbol/keyFor.mdx | 25 -- .../version-2.2.0/globals/Symbol/match.mdx | 19 -- .../version-2.2.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-2.2.0/globals/Symbol/replace.mdx | 15 -- .../version-2.2.0/globals/Symbol/search.mdx | 15 -- .../version-2.2.0/globals/Symbol/species.mdx | 21 -- .../version-2.2.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-2.2.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-2.2.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-2.2.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-2.2.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-2.2.0/globals/atob.mdx | 37 --- .../version-2.2.0/globals/btoa.mdx | 38 --- .../version-2.2.0/globals/clearInterval.mdx | 35 --- .../version-2.2.0/globals/clearTimeout.mdx | 36 --- .../version-2.2.0/globals/console/assert.mdx | 42 ---- .../version-2.2.0/globals/console/clear.mdx | 24 -- .../version-2.2.0/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-2.2.0/globals/console/debug.mdx | 26 -- .../version-2.2.0/globals/console/dir.mdx | 26 -- .../version-2.2.0/globals/console/dirxml.mdx | 25 -- .../version-2.2.0/globals/console/error.mdx | 26 -- .../version-2.2.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-2.2.0/globals/console/info.mdx | 26 -- .../version-2.2.0/globals/console/log.mdx | 30 --- .../version-2.2.0/globals/console/time.mdx | 29 --- .../version-2.2.0/globals/console/timeEnd.mdx | 26 -- .../version-2.2.0/globals/console/timeLog.mdx | 26 -- .../version-2.2.0/globals/console/trace.mdx | 27 --- .../version-2.2.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-2.2.0/globals/crypto/subtle.mdx | 16 -- .../version-2.2.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-2.2.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-2.2.0/globals/escape.mdx | 34 --- .../version-2.2.0/globals/eval.mdx | 36 --- .../version-2.2.0/globals/fetch.mdx | 62 ----- .../version-2.2.0/globals/globalThis.mdx | 20 -- .../version-2.2.0/globals/isFinite.mdx | 37 --- .../version-2.2.0/globals/isNaN.mdx | 36 --- .../version-2.2.0/globals/location.mdx | 18 -- .../version-2.2.0/globals/parseFloat.mdx | 41 ---- .../version-2.2.0/globals/parseInt.mdx | 68 ------ .../version-2.2.0/globals/setInterval.mdx | 61 ----- .../version-2.2.0/globals/setTimeout.mdx | 61 ----- .../version-2.2.0/globals/structuredClone.mdx | 33 --- .../version-2.2.0/globals/undefined.mdx | 25 -- .../version-2.2.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-2.2.0/index.mdx | 98 -------- .../version-2.2.0/migration-guide/index.mdx | 48 ---- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 47 ---- .../fastly:cache/SimpleCache/delete.mdx | 74 ------ .../fastly:cache/SimpleCache/get.mdx | 70 ------ .../fastly:cache/SimpleCache/getOrSet.mdx | 81 ------- .../fastly:cache/SimpleCache/set.mdx | 77 ------ .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-2.3.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-2.3.0/globals/Array/@@species.mdx | 57 ----- .../version-2.3.0/globals/Array/Array.mdx | 41 ---- .../version-2.3.0/globals/Array/from.mdx | 62 ----- .../version-2.3.0/globals/Array/isArray.mdx | 32 --- .../version-2.3.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-2.3.0/globals/BigInt/BigInt.mdx | 37 --- .../version-2.3.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-2.3.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-2.3.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-2.3.0/globals/Date/Date.mdx | 88 ------- .../version-2.3.0/globals/Date/UTC.mdx | 84 ------- .../version-2.3.0/globals/Date/now.mdx | 19 -- .../version-2.3.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-2.3.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-2.3.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-2.3.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-2.3.0/globals/JSON/parse.mdx | 50 ---- .../version-2.3.0/globals/JSON/stringify.mdx | 96 -------- .../version-2.3.0/globals/Map/@@species.mdx | 25 -- .../version-2.3.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-2.3.0/globals/Math/E.mdx | 17 -- .../version-2.3.0/globals/Math/LN10.mdx | 17 -- .../version-2.3.0/globals/Math/LN2.mdx | 17 -- .../version-2.3.0/globals/Math/LOG10e.mdx | 17 -- .../version-2.3.0/globals/Math/LOG2e.mdx | 17 -- .../version-2.3.0/globals/Math/PI.mdx | 17 -- .../version-2.3.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-2.3.0/globals/Math/SQRT2.mdx | 19 -- .../version-2.3.0/globals/Math/abs.mdx | 29 --- .../version-2.3.0/globals/Math/acos.mdx | 28 --- .../version-2.3.0/globals/Math/acosh.mdx | 28 --- .../version-2.3.0/globals/Math/asin.mdx | 28 --- .../version-2.3.0/globals/Math/asinh.mdx | 28 --- .../version-2.3.0/globals/Math/atan.mdx | 28 --- .../version-2.3.0/globals/Math/atan2.mdx | 51 ---- .../version-2.3.0/globals/Math/atanh.mdx | 29 --- .../version-2.3.0/globals/Math/cbrt.mdx | 28 --- .../version-2.3.0/globals/Math/ceil.mdx | 28 --- .../version-2.3.0/globals/Math/clz32.mdx | 34 --- .../version-2.3.0/globals/Math/cos.mdx | 28 --- .../version-2.3.0/globals/Math/cosh.mdx | 28 --- .../version-2.3.0/globals/Math/exp.mdx | 30 --- .../version-2.3.0/globals/Math/expm1.mdx | 32 --- .../version-2.3.0/globals/Math/floor.mdx | 28 --- .../version-2.3.0/globals/Math/fround.mdx | 32 --- .../version-2.3.0/globals/Math/hypot.mdx | 39 --- .../version-2.3.0/globals/Math/imul.mdx | 35 --- .../version-2.3.0/globals/Math/log.mdx | 32 --- .../version-2.3.0/globals/Math/log10.mdx | 30 --- .../version-2.3.0/globals/Math/log1p.mdx | 34 --- .../version-2.3.0/globals/Math/log2.mdx | 30 --- .../version-2.3.0/globals/Math/max.mdx | 33 --- .../version-2.3.0/globals/Math/min.mdx | 33 --- .../version-2.3.0/globals/Math/pow.mdx | 39 --- .../version-2.3.0/globals/Math/random.mdx | 21 -- .../version-2.3.0/globals/Math/round.mdx | 34 --- .../version-2.3.0/globals/Math/sign.mdx | 34 --- .../version-2.3.0/globals/Math/sin.mdx | 28 --- .../version-2.3.0/globals/Math/sinh.mdx | 29 --- .../version-2.3.0/globals/Math/sqrt.mdx | 29 --- .../version-2.3.0/globals/Math/tan.mdx | 31 --- .../version-2.3.0/globals/Math/tanh.mdx | 28 --- .../version-2.3.0/globals/Math/trunc.mdx | 30 --- .../version-2.3.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-2.3.0/globals/Number/NaN.mdx | 17 -- .../version-2.3.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-2.3.0/globals/Number/epsilon.mdx | 21 -- .../version-2.3.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-2.3.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-2.3.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-2.3.0/globals/Object/Object.mdx | 27 --- .../version-2.3.0/globals/Object/assign.mdx | 57 ----- .../version-2.3.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-2.3.0/globals/Object/entries.mdx | 30 --- .../version-2.3.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-2.3.0/globals/Object/hasOwn.mdx | 46 ---- .../version-2.3.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-2.3.0/globals/Object/isFrozen.mdx | 31 --- .../version-2.3.0/globals/Object/isSealed.mdx | 32 --- .../version-2.3.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-2.3.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-2.3.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-2.3.0/globals/Promise/Promise.mdx | 140 ----------- .../version-2.3.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-2.3.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-2.3.0/globals/Promise/race.mdx | 30 --- .../version-2.3.0/globals/Promise/reject.mdx | 32 --- .../version-2.3.0/globals/Promise/resolve.mdx | 39 --- .../version-2.3.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-2.3.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-2.3.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-2.3.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-2.3.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-2.3.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-2.3.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-2.3.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-2.3.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-2.3.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-2.3.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 19 -- .../version-2.3.0/globals/Set/@@species.mdx | 25 -- .../version-2.3.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-2.3.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-2.3.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 87 ------- .../globals/SubtleCrypto/prototype/sign.mdx | 51 ---- .../globals/SubtleCrypto/prototype/verify.mdx | 51 ---- .../version-2.3.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-2.3.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-2.3.0/globals/Symbol/iterator.mdx | 26 -- .../version-2.3.0/globals/Symbol/keyFor.mdx | 25 -- .../version-2.3.0/globals/Symbol/match.mdx | 19 -- .../version-2.3.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-2.3.0/globals/Symbol/replace.mdx | 15 -- .../version-2.3.0/globals/Symbol/search.mdx | 15 -- .../version-2.3.0/globals/Symbol/species.mdx | 21 -- .../version-2.3.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-2.3.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-2.3.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-2.3.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-2.3.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-2.3.0/globals/atob.mdx | 37 --- .../version-2.3.0/globals/btoa.mdx | 38 --- .../version-2.3.0/globals/clearInterval.mdx | 35 --- .../version-2.3.0/globals/clearTimeout.mdx | 36 --- .../version-2.3.0/globals/console/assert.mdx | 42 ---- .../version-2.3.0/globals/console/clear.mdx | 24 -- .../version-2.3.0/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-2.3.0/globals/console/debug.mdx | 26 -- .../version-2.3.0/globals/console/dir.mdx | 26 -- .../version-2.3.0/globals/console/dirxml.mdx | 25 -- .../version-2.3.0/globals/console/error.mdx | 26 -- .../version-2.3.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-2.3.0/globals/console/info.mdx | 26 -- .../version-2.3.0/globals/console/log.mdx | 30 --- .../version-2.3.0/globals/console/time.mdx | 29 --- .../version-2.3.0/globals/console/timeEnd.mdx | 26 -- .../version-2.3.0/globals/console/timeLog.mdx | 26 -- .../version-2.3.0/globals/console/trace.mdx | 27 --- .../version-2.3.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-2.3.0/globals/crypto/subtle.mdx | 16 -- .../version-2.3.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-2.3.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-2.3.0/globals/escape.mdx | 34 --- .../version-2.3.0/globals/eval.mdx | 36 --- .../version-2.3.0/globals/fetch.mdx | 62 ----- .../version-2.3.0/globals/globalThis.mdx | 20 -- .../version-2.3.0/globals/isFinite.mdx | 37 --- .../version-2.3.0/globals/isNaN.mdx | 36 --- .../version-2.3.0/globals/location.mdx | 18 -- .../version-2.3.0/globals/parseFloat.mdx | 41 ---- .../version-2.3.0/globals/parseInt.mdx | 68 ------ .../version-2.3.0/globals/setInterval.mdx | 61 ----- .../version-2.3.0/globals/setTimeout.mdx | 61 ----- .../version-2.3.0/globals/structuredClone.mdx | 33 --- .../version-2.3.0/globals/undefined.mdx | 25 -- .../version-2.3.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-2.3.0/index.mdx | 98 -------- .../version-2.3.0/migration-guide/index.mdx | 48 ---- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 47 ---- .../fastly:cache/SimpleCache/delete.mdx | 74 ------ .../fastly:cache/SimpleCache/get.mdx | 70 ------ .../fastly:cache/SimpleCache/getOrSet.mdx | 81 ------- .../fastly:cache/SimpleCache/set.mdx | 77 ------ .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-2.4.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-2.4.0/globals/Array/@@species.mdx | 57 ----- .../version-2.4.0/globals/Array/Array.mdx | 41 ---- .../version-2.4.0/globals/Array/from.mdx | 62 ----- .../version-2.4.0/globals/Array/isArray.mdx | 32 --- .../version-2.4.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-2.4.0/globals/BigInt/BigInt.mdx | 37 --- .../version-2.4.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-2.4.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-2.4.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-2.4.0/globals/Date/Date.mdx | 88 ------- .../version-2.4.0/globals/Date/UTC.mdx | 84 ------- .../version-2.4.0/globals/Date/now.mdx | 19 -- .../version-2.4.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-2.4.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-2.4.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-2.4.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-2.4.0/globals/JSON/parse.mdx | 50 ---- .../version-2.4.0/globals/JSON/stringify.mdx | 96 -------- .../version-2.4.0/globals/Map/@@species.mdx | 25 -- .../version-2.4.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-2.4.0/globals/Math/E.mdx | 17 -- .../version-2.4.0/globals/Math/LN10.mdx | 17 -- .../version-2.4.0/globals/Math/LN2.mdx | 17 -- .../version-2.4.0/globals/Math/LOG10e.mdx | 17 -- .../version-2.4.0/globals/Math/LOG2e.mdx | 17 -- .../version-2.4.0/globals/Math/PI.mdx | 17 -- .../version-2.4.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-2.4.0/globals/Math/SQRT2.mdx | 19 -- .../version-2.4.0/globals/Math/abs.mdx | 29 --- .../version-2.4.0/globals/Math/acos.mdx | 28 --- .../version-2.4.0/globals/Math/acosh.mdx | 28 --- .../version-2.4.0/globals/Math/asin.mdx | 28 --- .../version-2.4.0/globals/Math/asinh.mdx | 28 --- .../version-2.4.0/globals/Math/atan.mdx | 28 --- .../version-2.4.0/globals/Math/atan2.mdx | 51 ---- .../version-2.4.0/globals/Math/atanh.mdx | 29 --- .../version-2.4.0/globals/Math/cbrt.mdx | 28 --- .../version-2.4.0/globals/Math/ceil.mdx | 28 --- .../version-2.4.0/globals/Math/clz32.mdx | 34 --- .../version-2.4.0/globals/Math/cos.mdx | 28 --- .../version-2.4.0/globals/Math/cosh.mdx | 28 --- .../version-2.4.0/globals/Math/exp.mdx | 30 --- .../version-2.4.0/globals/Math/expm1.mdx | 32 --- .../version-2.4.0/globals/Math/floor.mdx | 28 --- .../version-2.4.0/globals/Math/fround.mdx | 32 --- .../version-2.4.0/globals/Math/hypot.mdx | 39 --- .../version-2.4.0/globals/Math/imul.mdx | 35 --- .../version-2.4.0/globals/Math/log.mdx | 32 --- .../version-2.4.0/globals/Math/log10.mdx | 30 --- .../version-2.4.0/globals/Math/log1p.mdx | 34 --- .../version-2.4.0/globals/Math/log2.mdx | 30 --- .../version-2.4.0/globals/Math/max.mdx | 33 --- .../version-2.4.0/globals/Math/min.mdx | 33 --- .../version-2.4.0/globals/Math/pow.mdx | 39 --- .../version-2.4.0/globals/Math/random.mdx | 21 -- .../version-2.4.0/globals/Math/round.mdx | 34 --- .../version-2.4.0/globals/Math/sign.mdx | 34 --- .../version-2.4.0/globals/Math/sin.mdx | 28 --- .../version-2.4.0/globals/Math/sinh.mdx | 29 --- .../version-2.4.0/globals/Math/sqrt.mdx | 29 --- .../version-2.4.0/globals/Math/tan.mdx | 31 --- .../version-2.4.0/globals/Math/tanh.mdx | 28 --- .../version-2.4.0/globals/Math/trunc.mdx | 30 --- .../version-2.4.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-2.4.0/globals/Number/NaN.mdx | 17 -- .../version-2.4.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-2.4.0/globals/Number/epsilon.mdx | 21 -- .../version-2.4.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-2.4.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-2.4.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-2.4.0/globals/Object/Object.mdx | 27 --- .../version-2.4.0/globals/Object/assign.mdx | 57 ----- .../version-2.4.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-2.4.0/globals/Object/entries.mdx | 30 --- .../version-2.4.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-2.4.0/globals/Object/hasOwn.mdx | 46 ---- .../version-2.4.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-2.4.0/globals/Object/isFrozen.mdx | 31 --- .../version-2.4.0/globals/Object/isSealed.mdx | 32 --- .../version-2.4.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-2.4.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-2.4.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-2.4.0/globals/Promise/Promise.mdx | 140 ----------- .../version-2.4.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-2.4.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-2.4.0/globals/Promise/race.mdx | 30 --- .../version-2.4.0/globals/Promise/reject.mdx | 32 --- .../version-2.4.0/globals/Promise/resolve.mdx | 39 --- .../version-2.4.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-2.4.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-2.4.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-2.4.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-2.4.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-2.4.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-2.4.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-2.4.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-2.4.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-2.4.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-2.4.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 19 -- .../version-2.4.0/globals/Set/@@species.mdx | 25 -- .../version-2.4.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-2.4.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-2.4.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 87 ------- .../globals/SubtleCrypto/prototype/sign.mdx | 51 ---- .../globals/SubtleCrypto/prototype/verify.mdx | 51 ---- .../version-2.4.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-2.4.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-2.4.0/globals/Symbol/iterator.mdx | 26 -- .../version-2.4.0/globals/Symbol/keyFor.mdx | 25 -- .../version-2.4.0/globals/Symbol/match.mdx | 19 -- .../version-2.4.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-2.4.0/globals/Symbol/replace.mdx | 15 -- .../version-2.4.0/globals/Symbol/search.mdx | 15 -- .../version-2.4.0/globals/Symbol/species.mdx | 21 -- .../version-2.4.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-2.4.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-2.4.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-2.4.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-2.4.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-2.4.0/globals/atob.mdx | 37 --- .../version-2.4.0/globals/btoa.mdx | 38 --- .../version-2.4.0/globals/clearInterval.mdx | 35 --- .../version-2.4.0/globals/clearTimeout.mdx | 36 --- .../version-2.4.0/globals/console/assert.mdx | 42 ---- .../version-2.4.0/globals/console/clear.mdx | 24 -- .../version-2.4.0/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-2.4.0/globals/console/debug.mdx | 26 -- .../version-2.4.0/globals/console/dir.mdx | 26 -- .../version-2.4.0/globals/console/dirxml.mdx | 25 -- .../version-2.4.0/globals/console/error.mdx | 26 -- .../version-2.4.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-2.4.0/globals/console/info.mdx | 26 -- .../version-2.4.0/globals/console/log.mdx | 30 --- .../version-2.4.0/globals/console/time.mdx | 29 --- .../version-2.4.0/globals/console/timeEnd.mdx | 26 -- .../version-2.4.0/globals/console/timeLog.mdx | 26 -- .../version-2.4.0/globals/console/trace.mdx | 27 --- .../version-2.4.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-2.4.0/globals/crypto/subtle.mdx | 16 -- .../version-2.4.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-2.4.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-2.4.0/globals/escape.mdx | 34 --- .../version-2.4.0/globals/eval.mdx | 36 --- .../version-2.4.0/globals/fetch.mdx | 62 ----- .../version-2.4.0/globals/globalThis.mdx | 20 -- .../version-2.4.0/globals/isFinite.mdx | 37 --- .../version-2.4.0/globals/isNaN.mdx | 36 --- .../version-2.4.0/globals/location.mdx | 18 -- .../version-2.4.0/globals/parseFloat.mdx | 41 ---- .../version-2.4.0/globals/parseInt.mdx | 68 ------ .../version-2.4.0/globals/performance/now.mdx | 25 -- .../globals/performance/timeOrigin.mdx | 16 -- .../version-2.4.0/globals/setInterval.mdx | 61 ----- .../version-2.4.0/globals/setTimeout.mdx | 61 ----- .../version-2.4.0/globals/structuredClone.mdx | 33 --- .../version-2.4.0/globals/undefined.mdx | 25 -- .../version-2.4.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-2.4.0/index.mdx | 98 -------- .../version-2.4.0/migration-guide/index.mdx | 48 ---- .../fastly:backend/Backend/Backend.mdx | 221 ----------------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 47 ---- .../fastly:cache/SimpleCache/get.mdx | 65 ----- .../fastly:cache/SimpleCache/getOrSet.mdx | 81 ------- .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-3.0.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-3.0.0/globals/Array/@@species.mdx | 57 ----- .../version-3.0.0/globals/Array/Array.mdx | 41 ---- .../version-3.0.0/globals/Array/from.mdx | 62 ----- .../version-3.0.0/globals/Array/isArray.mdx | 32 --- .../version-3.0.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-3.0.0/globals/BigInt/BigInt.mdx | 37 --- .../version-3.0.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-3.0.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-3.0.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-3.0.0/globals/Date/Date.mdx | 88 ------- .../version-3.0.0/globals/Date/UTC.mdx | 84 ------- .../version-3.0.0/globals/Date/now.mdx | 19 -- .../version-3.0.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-3.0.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-3.0.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../version-3.0.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-3.0.0/globals/JSON/parse.mdx | 50 ---- .../version-3.0.0/globals/JSON/stringify.mdx | 96 -------- .../version-3.0.0/globals/Map/@@species.mdx | 25 -- .../version-3.0.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-3.0.0/globals/Math/E.mdx | 17 -- .../version-3.0.0/globals/Math/LN10.mdx | 17 -- .../version-3.0.0/globals/Math/LN2.mdx | 17 -- .../version-3.0.0/globals/Math/LOG10e.mdx | 17 -- .../version-3.0.0/globals/Math/LOG2e.mdx | 17 -- .../version-3.0.0/globals/Math/PI.mdx | 17 -- .../version-3.0.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-3.0.0/globals/Math/SQRT2.mdx | 19 -- .../version-3.0.0/globals/Math/abs.mdx | 29 --- .../version-3.0.0/globals/Math/acos.mdx | 28 --- .../version-3.0.0/globals/Math/acosh.mdx | 28 --- .../version-3.0.0/globals/Math/asin.mdx | 28 --- .../version-3.0.0/globals/Math/asinh.mdx | 28 --- .../version-3.0.0/globals/Math/atan.mdx | 28 --- .../version-3.0.0/globals/Math/atan2.mdx | 51 ---- .../version-3.0.0/globals/Math/atanh.mdx | 29 --- .../version-3.0.0/globals/Math/cbrt.mdx | 28 --- .../version-3.0.0/globals/Math/ceil.mdx | 28 --- .../version-3.0.0/globals/Math/clz32.mdx | 34 --- .../version-3.0.0/globals/Math/cos.mdx | 28 --- .../version-3.0.0/globals/Math/cosh.mdx | 28 --- .../version-3.0.0/globals/Math/exp.mdx | 30 --- .../version-3.0.0/globals/Math/expm1.mdx | 32 --- .../version-3.0.0/globals/Math/floor.mdx | 28 --- .../version-3.0.0/globals/Math/fround.mdx | 32 --- .../version-3.0.0/globals/Math/hypot.mdx | 39 --- .../version-3.0.0/globals/Math/imul.mdx | 35 --- .../version-3.0.0/globals/Math/log.mdx | 32 --- .../version-3.0.0/globals/Math/log10.mdx | 30 --- .../version-3.0.0/globals/Math/log1p.mdx | 34 --- .../version-3.0.0/globals/Math/log2.mdx | 30 --- .../version-3.0.0/globals/Math/max.mdx | 33 --- .../version-3.0.0/globals/Math/min.mdx | 33 --- .../version-3.0.0/globals/Math/pow.mdx | 39 --- .../version-3.0.0/globals/Math/random.mdx | 21 -- .../version-3.0.0/globals/Math/round.mdx | 34 --- .../version-3.0.0/globals/Math/sign.mdx | 34 --- .../version-3.0.0/globals/Math/sin.mdx | 28 --- .../version-3.0.0/globals/Math/sinh.mdx | 29 --- .../version-3.0.0/globals/Math/sqrt.mdx | 29 --- .../version-3.0.0/globals/Math/tan.mdx | 31 --- .../version-3.0.0/globals/Math/tanh.mdx | 28 --- .../version-3.0.0/globals/Math/trunc.mdx | 30 --- .../version-3.0.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-3.0.0/globals/Number/NaN.mdx | 17 -- .../version-3.0.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-3.0.0/globals/Number/epsilon.mdx | 21 -- .../version-3.0.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-3.0.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-3.0.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-3.0.0/globals/Object/Object.mdx | 27 --- .../version-3.0.0/globals/Object/assign.mdx | 57 ----- .../version-3.0.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-3.0.0/globals/Object/entries.mdx | 30 --- .../version-3.0.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-3.0.0/globals/Object/hasOwn.mdx | 46 ---- .../version-3.0.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-3.0.0/globals/Object/isFrozen.mdx | 31 --- .../version-3.0.0/globals/Object/isSealed.mdx | 32 --- .../version-3.0.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-3.0.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-3.0.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-3.0.0/globals/Promise/Promise.mdx | 140 ----------- .../version-3.0.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-3.0.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-3.0.0/globals/Promise/race.mdx | 30 --- .../version-3.0.0/globals/Promise/reject.mdx | 32 --- .../version-3.0.0/globals/Promise/resolve.mdx | 39 --- .../version-3.0.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-3.0.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-3.0.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-3.0.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-3.0.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-3.0.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-3.0.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-3.0.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-3.0.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-3.0.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-3.0.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../version-3.0.0/globals/Set/@@species.mdx | 25 -- .../version-3.0.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-3.0.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-3.0.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 97 -------- .../version-3.0.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-3.0.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-3.0.0/globals/Symbol/iterator.mdx | 26 -- .../version-3.0.0/globals/Symbol/keyFor.mdx | 25 -- .../version-3.0.0/globals/Symbol/match.mdx | 19 -- .../version-3.0.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-3.0.0/globals/Symbol/replace.mdx | 15 -- .../version-3.0.0/globals/Symbol/search.mdx | 15 -- .../version-3.0.0/globals/Symbol/species.mdx | 21 -- .../version-3.0.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-3.0.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-3.0.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-3.0.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-3.0.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-3.0.0/globals/atob.mdx | 37 --- .../version-3.0.0/globals/btoa.mdx | 38 --- .../version-3.0.0/globals/clearInterval.mdx | 35 --- .../version-3.0.0/globals/clearTimeout.mdx | 36 --- .../version-3.0.0/globals/console/assert.mdx | 42 ---- .../version-3.0.0/globals/console/clear.mdx | 24 -- .../globals/console/countReset.mdx | 28 --- .../version-3.0.0/globals/console/debug.mdx | 26 -- .../version-3.0.0/globals/console/dir.mdx | 26 -- .../version-3.0.0/globals/console/dirxml.mdx | 25 -- .../version-3.0.0/globals/console/error.mdx | 26 -- .../version-3.0.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-3.0.0/globals/console/info.mdx | 26 -- .../version-3.0.0/globals/console/log.mdx | 30 --- .../version-3.0.0/globals/console/time.mdx | 29 --- .../version-3.0.0/globals/console/timeEnd.mdx | 26 -- .../version-3.0.0/globals/console/timeLog.mdx | 26 -- .../version-3.0.0/globals/console/trace.mdx | 27 --- .../version-3.0.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-3.0.0/globals/crypto/subtle.mdx | 16 -- .../version-3.0.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-3.0.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-3.0.0/globals/escape.mdx | 34 --- .../version-3.0.0/globals/eval.mdx | 36 --- .../version-3.0.0/globals/fetch.mdx | 62 ----- .../version-3.0.0/globals/globalThis.mdx | 20 -- .../version-3.0.0/globals/isFinite.mdx | 37 --- .../version-3.0.0/globals/isNaN.mdx | 36 --- .../version-3.0.0/globals/location.mdx | 18 -- .../version-3.0.0/globals/parseFloat.mdx | 41 ---- .../version-3.0.0/globals/parseInt.mdx | 68 ------ .../version-3.0.0/globals/performance/now.mdx | 25 -- .../globals/performance/timeOrigin.mdx | 16 -- .../version-3.0.0/globals/setInterval.mdx | 61 ----- .../version-3.0.0/globals/setTimeout.mdx | 61 ----- .../version-3.0.0/globals/structuredClone.mdx | 33 --- .../version-3.0.0/globals/undefined.mdx | 25 -- .../version-3.0.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-3.0.0/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 227 ------------------ .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 47 ---- .../fastly:cache/SimpleCache/get.mdx | 65 ----- .../fastly:cache/SimpleCache/getOrSet.mdx | 81 ------- .../fastly:cache/SimpleCache/purge.mdx | 81 ------- .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-3.1.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-3.1.0/globals/Array/@@species.mdx | 57 ----- .../version-3.1.0/globals/Array/Array.mdx | 41 ---- .../version-3.1.0/globals/Array/from.mdx | 62 ----- .../version-3.1.0/globals/Array/isArray.mdx | 32 --- .../version-3.1.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-3.1.0/globals/BigInt/BigInt.mdx | 37 --- .../version-3.1.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-3.1.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-3.1.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DOMException/DOMException.mdx | 107 --------- .../globals/DOMException/code.mdx | 16 -- .../globals/DOMException/message.mdx | 14 -- .../globals/DOMException/name.mdx | 14 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-3.1.0/globals/Date/Date.mdx | 88 ------- .../version-3.1.0/globals/Date/UTC.mdx | 84 ------- .../version-3.1.0/globals/Date/now.mdx | 19 -- .../version-3.1.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-3.1.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-3.1.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../HmacImportParams/HmacImportParams.mdx | 21 -- .../version-3.1.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-3.1.0/globals/JSON/parse.mdx | 50 ---- .../version-3.1.0/globals/JSON/stringify.mdx | 96 -------- .../version-3.1.0/globals/Map/@@species.mdx | 25 -- .../version-3.1.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-3.1.0/globals/Math/E.mdx | 17 -- .../version-3.1.0/globals/Math/LN10.mdx | 17 -- .../version-3.1.0/globals/Math/LN2.mdx | 17 -- .../version-3.1.0/globals/Math/LOG10e.mdx | 17 -- .../version-3.1.0/globals/Math/LOG2e.mdx | 17 -- .../version-3.1.0/globals/Math/PI.mdx | 17 -- .../version-3.1.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-3.1.0/globals/Math/SQRT2.mdx | 19 -- .../version-3.1.0/globals/Math/abs.mdx | 29 --- .../version-3.1.0/globals/Math/acos.mdx | 28 --- .../version-3.1.0/globals/Math/acosh.mdx | 28 --- .../version-3.1.0/globals/Math/asin.mdx | 28 --- .../version-3.1.0/globals/Math/asinh.mdx | 28 --- .../version-3.1.0/globals/Math/atan.mdx | 28 --- .../version-3.1.0/globals/Math/atan2.mdx | 51 ---- .../version-3.1.0/globals/Math/atanh.mdx | 29 --- .../version-3.1.0/globals/Math/cbrt.mdx | 28 --- .../version-3.1.0/globals/Math/ceil.mdx | 28 --- .../version-3.1.0/globals/Math/clz32.mdx | 34 --- .../version-3.1.0/globals/Math/cos.mdx | 28 --- .../version-3.1.0/globals/Math/cosh.mdx | 28 --- .../version-3.1.0/globals/Math/exp.mdx | 30 --- .../version-3.1.0/globals/Math/expm1.mdx | 32 --- .../version-3.1.0/globals/Math/floor.mdx | 28 --- .../version-3.1.0/globals/Math/fround.mdx | 32 --- .../version-3.1.0/globals/Math/hypot.mdx | 39 --- .../version-3.1.0/globals/Math/imul.mdx | 35 --- .../version-3.1.0/globals/Math/log.mdx | 32 --- .../version-3.1.0/globals/Math/log10.mdx | 30 --- .../version-3.1.0/globals/Math/log1p.mdx | 34 --- .../version-3.1.0/globals/Math/log2.mdx | 30 --- .../version-3.1.0/globals/Math/max.mdx | 33 --- .../version-3.1.0/globals/Math/min.mdx | 33 --- .../version-3.1.0/globals/Math/pow.mdx | 39 --- .../version-3.1.0/globals/Math/random.mdx | 21 -- .../version-3.1.0/globals/Math/round.mdx | 34 --- .../version-3.1.0/globals/Math/sign.mdx | 34 --- .../version-3.1.0/globals/Math/sin.mdx | 28 --- .../version-3.1.0/globals/Math/sinh.mdx | 29 --- .../version-3.1.0/globals/Math/sqrt.mdx | 29 --- .../version-3.1.0/globals/Math/tan.mdx | 31 --- .../version-3.1.0/globals/Math/tanh.mdx | 28 --- .../version-3.1.0/globals/Math/trunc.mdx | 30 --- .../version-3.1.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-3.1.0/globals/Number/NaN.mdx | 17 -- .../version-3.1.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-3.1.0/globals/Number/epsilon.mdx | 21 -- .../version-3.1.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-3.1.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-3.1.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-3.1.0/globals/Object/Object.mdx | 27 --- .../version-3.1.0/globals/Object/assign.mdx | 57 ----- .../version-3.1.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-3.1.0/globals/Object/entries.mdx | 30 --- .../version-3.1.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-3.1.0/globals/Object/hasOwn.mdx | 46 ---- .../version-3.1.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-3.1.0/globals/Object/isFrozen.mdx | 31 --- .../version-3.1.0/globals/Object/isSealed.mdx | 32 --- .../version-3.1.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-3.1.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-3.1.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-3.1.0/globals/Promise/Promise.mdx | 140 ----------- .../version-3.1.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-3.1.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-3.1.0/globals/Promise/race.mdx | 30 --- .../version-3.1.0/globals/Promise/reject.mdx | 32 --- .../version-3.1.0/globals/Promise/resolve.mdx | 39 --- .../version-3.1.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-3.1.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-3.1.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-3.1.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-3.1.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-3.1.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-3.1.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-3.1.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-3.1.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-3.1.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-3.1.0/globals/Request/Request.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 18 -- .../version-3.1.0/globals/Set/@@species.mdx | 25 -- .../version-3.1.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-3.1.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-3.1.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 97 -------- .../globals/SubtleCrypto/prototype/sign.mdx | 60 ----- .../globals/SubtleCrypto/prototype/verify.mdx | 52 ---- .../version-3.1.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-3.1.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-3.1.0/globals/Symbol/iterator.mdx | 26 -- .../version-3.1.0/globals/Symbol/keyFor.mdx | 25 -- .../version-3.1.0/globals/Symbol/match.mdx | 19 -- .../version-3.1.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-3.1.0/globals/Symbol/replace.mdx | 15 -- .../version-3.1.0/globals/Symbol/search.mdx | 15 -- .../version-3.1.0/globals/Symbol/species.mdx | 21 -- .../version-3.1.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-3.1.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-3.1.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-3.1.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-3.1.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-3.1.0/globals/atob.mdx | 37 --- .../version-3.1.0/globals/btoa.mdx | 38 --- .../version-3.1.0/globals/clearInterval.mdx | 35 --- .../version-3.1.0/globals/clearTimeout.mdx | 36 --- .../version-3.1.0/globals/console/assert.mdx | 42 ---- .../version-3.1.0/globals/console/clear.mdx | 24 -- .../version-3.1.0/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-3.1.0/globals/console/debug.mdx | 26 -- .../version-3.1.0/globals/console/dir.mdx | 26 -- .../version-3.1.0/globals/console/dirxml.mdx | 25 -- .../version-3.1.0/globals/console/error.mdx | 26 -- .../version-3.1.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-3.1.0/globals/console/info.mdx | 26 -- .../version-3.1.0/globals/console/log.mdx | 30 --- .../version-3.1.0/globals/console/time.mdx | 29 --- .../version-3.1.0/globals/console/timeEnd.mdx | 26 -- .../version-3.1.0/globals/console/timeLog.mdx | 26 -- .../version-3.1.0/globals/console/trace.mdx | 27 --- .../version-3.1.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-3.1.0/globals/crypto/subtle.mdx | 16 -- .../version-3.1.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-3.1.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-3.1.0/globals/escape.mdx | 34 --- .../version-3.1.0/globals/eval.mdx | 36 --- .../version-3.1.0/globals/fetch.mdx | 62 ----- .../version-3.1.0/globals/globalThis.mdx | 20 -- .../version-3.1.0/globals/isFinite.mdx | 37 --- .../version-3.1.0/globals/isNaN.mdx | 36 --- .../version-3.1.0/globals/location.mdx | 18 -- .../version-3.1.0/globals/parseFloat.mdx | 41 ---- .../version-3.1.0/globals/parseInt.mdx | 68 ------ .../version-3.1.0/globals/performance/now.mdx | 25 -- .../globals/performance/timeOrigin.mdx | 16 -- .../version-3.1.0/globals/setInterval.mdx | 61 ----- .../version-3.1.0/globals/setTimeout.mdx | 61 ----- .../version-3.1.0/globals/structuredClone.mdx | 33 --- .../version-3.1.0/globals/undefined.mdx | 25 -- .../version-3.1.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-3.1.0/index.mdx | 98 -------- .../version-3.1.0/migration-guide/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 0 .../fastly:backend/Backend/exists.mdx | 0 .../fastly:backend/Backend/fromName.mdx | 0 .../fastly:backend/Backend/health.mdx | 0 .../Backend/prototype/toName.mdx | 0 .../Backend/prototype/toString.mdx | 0 .../CacheOverride/CacheOverride.mdx | 0 .../fastly:cache/CacheEntry/age.mdx | 0 .../fastly:cache/CacheEntry/body.mdx | 0 .../fastly:cache/CacheEntry/close.mdx | 0 .../fastly:cache/CacheEntry/hits.mdx | 0 .../fastly:cache/CacheEntry/length.mdx | 0 .../fastly:cache/CacheEntry/maxAge.mdx | 0 .../CacheEntry/staleWhileRevalidate.mdx | 0 .../fastly:cache/CacheEntry/state.mdx | 0 .../fastly:cache/CacheEntry/userMetadata.mdx | 0 .../fastly:cache/CacheState/found.mdx | 0 .../CacheState/mustInsertOrUpdate.mdx | 0 .../fastly:cache/CacheState/stale.mdx | 0 .../fastly:cache/CacheState/usable.mdx | 0 .../fastly:cache/CoreCache/insert.mdx | 0 .../fastly:cache/CoreCache/lookup.mdx | 0 .../CoreCache/transactionLookup.mdx | 2 +- .../fastly:cache/SimpleCache/SimpleCache.mdx | 0 .../fastly:cache/SimpleCache/get.mdx | 0 .../fastly:cache/SimpleCache/getOrSet.mdx | 0 .../fastly:cache/SimpleCache/purge.mdx | 0 .../SimpleCacheEntry/arrayBuffer.mdx | 0 .../fastly:cache/SimpleCacheEntry/body.mdx | 0 .../SimpleCacheEntry/bodyUsed.mdx | 0 .../fastly:cache/SimpleCacheEntry/json.mdx | 0 .../fastly:cache/SimpleCacheEntry/text.mdx | 0 .../TransactionCacheEntry/age.mdx | 0 .../TransactionCacheEntry/body.mdx | 0 .../TransactionCacheEntry/cancel.mdx | 0 .../TransactionCacheEntry/close.mdx | 0 .../TransactionCacheEntry/hits.mdx | 0 .../TransactionCacheEntry/insert.mdx | 0 .../insertAndStreamBack.mdx | 0 .../TransactionCacheEntry/length.mdx | 0 .../TransactionCacheEntry/maxAge.mdx | 0 .../staleWhileRevalidate.mdx | 0 .../TransactionCacheEntry/state.mdx | 0 .../TransactionCacheEntry/update.mdx | 0 .../TransactionCacheEntry/userMetadata.mdx | 0 .../ConfigStore/ConfigStore.mdx | 0 .../ConfigStore/prototype/get.mdx | 0 .../fastly:device/Device/lookup.mdx | 22 ++ .../fastly:device/Device/prototype/brand.mdx | 16 ++ .../Device/prototype/hardwareType.mdx | 18 ++ .../Device/prototype/isDesktop.mdx | 15 ++ .../Device/prototype/isGameConsole.mdx | 15 ++ .../Device/prototype/isMediaPlayer.mdx | 15 ++ .../Device/prototype/isMobile.mdx | 15 ++ .../Device/prototype/isSmartTV.mdx | 15 ++ .../Device/prototype/isTablet.mdx | 15 ++ .../Device/prototype/isTouchscreen.mdx | 15 ++ .../fastly:device/Device/prototype/model.mdx | 15 ++ .../fastly:device/Device/prototype/name.mdx | 15 ++ .../fastly:device/Device/prototype/toJSON.mdx | 24 ++ .../Dictionary/Dictionary.mdx | 0 .../Dictionary/prototype/get.mdx | 0 .../EdgeRateLimiter/EdgeRateLimiter.mdx | 0 .../EdgeRateLimiter/prototype/checkRate.mdx | 0 .../PenaltyBox/PenaltyBox.mdx | 0 .../PenaltyBox/prototype/add.mdx | 0 .../PenaltyBox/prototype/has.mdx | 0 .../RateCounter/RateCounter.mdx | 0 .../RateCounter/prototype/increment.mdx | 0 .../RateCounter/prototype/lookupCount.mdx | 0 .../RateCounter/prototype/lookupRate.mdx | 0 .../fastly:env/env.mdx | 0 .../allowDynamicBackends.mdx | 0 .../fastly:experimental/includeBytes.mdx | 0 .../fastly:fanout/createFanoutHandoff.mdx | 0 .../getGeolocationForIpAddress.mdx | 0 .../fastly:kv-store/KVStore/KVStore.mdx | 0 .../fastly:kv-store/KVStore/prototype/get.mdx | 0 .../fastly:kv-store/KVStore/prototype/put.mdx | 0 .../KVStoreEntry/prototype/arrayBuffer.mdx | 0 .../KVStoreEntry/prototype/body.mdx | 0 .../KVStoreEntry/prototype/bodyUsed.mdx | 0 .../KVStoreEntry/prototype/json.mdx | 0 .../KVStoreEntry/prototype/text.mdx | 0 .../fastly:logger/Logger/Logger.mdx | 0 .../fastly:logger/Logger/prototype/log.mdx | 0 .../SecretStore/SecretStore.mdx | 0 .../SecretStore/prototype/get.mdx | 0 .../SecretStoreEntry/prototype/plaintext.mdx | 0 .../AggregrateError/AggregrateError.mdx | 0 .../globals/Array/@@species.mdx | 0 .../globals/Array/Array.mdx | 0 .../globals/Array/from.mdx | 0 .../globals/Array/isArray.mdx | 0 .../globals/Array/of.mdx | 0 .../globals/Array/prototype/@@iterator.mdx | 0 .../globals/Array/prototype/@@unscopables.mdx | 0 .../globals/Array/prototype/at.mdx | 0 .../globals/Array/prototype/concat.mdx | 0 .../globals/Array/prototype/copyWithin.mdx | 0 .../globals/Array/prototype/entries.mdx | 0 .../globals/Array/prototype/every.mdx | 0 .../globals/Array/prototype/fill.mdx | 0 .../globals/Array/prototype/filter.mdx | 0 .../globals/Array/prototype/find.mdx | 0 .../globals/Array/prototype/findIndex.mdx | 0 .../globals/Array/prototype/flat.mdx | 0 .../globals/Array/prototype/flatMap.mdx | 0 .../globals/Array/prototype/forEach.mdx | 0 .../globals/Array/prototype/includes.mdx | 0 .../globals/Array/prototype/indexOf.mdx | 0 .../globals/Array/prototype/join.mdx | 0 .../globals/Array/prototype/keys.mdx | 0 .../globals/Array/prototype/lastIndexOf.mdx | 0 .../globals/Array/prototype/length.mdx | 0 .../globals/Array/prototype/map.mdx | 0 .../globals/Array/prototype/pop.mdx | 0 .../globals/Array/prototype/push.mdx | 0 .../globals/Array/prototype/reduce.mdx | 0 .../globals/Array/prototype/reduceRight.mdx | 0 .../globals/Array/prototype/reverse.mdx | 0 .../globals/Array/prototype/shift.mdx | 0 .../globals/Array/prototype/slice.mdx | 0 .../globals/Array/prototype/some.mdx | 0 .../globals/Array/prototype/sort.mdx | 0 .../globals/Array/prototype/splice.mdx | 0 .../Array/prototype/toLocaleString.mdx | 0 .../globals/Array/prototype/toString.mdx | 0 .../globals/Array/prototype/unshift.mdx | 0 .../globals/Array/prototype/values.mdx | 0 .../globals/ArrayBuffer/@@species.mdx | 0 .../globals/ArrayBuffer/ArrayBuffer.mdx | 0 .../globals/ArrayBuffer/isView.mdx | 0 .../ArrayBuffer/prototype/byteLength.mdx | 0 .../globals/ArrayBuffer/prototype/slice.mdx | 0 .../globals/BigInt/BigInt.mdx | 0 .../globals/BigInt/asIntN.mdx | 0 .../globals/BigInt/asUintN.mdx | 0 .../BigInt/prototype/toLocaleString.mdx | 0 .../globals/BigInt/prototype/toString.mdx | 0 .../globals/BigInt/prototype/valueOf.mdx | 0 .../globals/BigInt64Array/BigInt64Array.mdx | 0 .../globals/BigUint64Array/BigUint64Array.mdx | 0 .../globals/Boolean/Boolean.mdx | 0 .../globals/Boolean/prototype/toString.mdx | 0 .../globals/Boolean/prototype/valueOf.mdx | 0 .../ByteLengthQueuingStrategy.mdx | 0 .../prototype/size.mdx | 0 .../CompressionStream/CompressionStream.mdx | 0 .../CompressionStream/prototype/readable.mdx | 0 .../CompressionStream/prototype/writable.mdx | 0 .../globals/CryptoKey/CryptoKey.mdx | 0 .../globals/CryptoKey/prototype/algorithm.mdx | 0 .../CryptoKey/prototype/extractable.mdx | 0 .../globals/CryptoKey/prototype/type.mdx | 0 .../globals/CryptoKey/prototype/usages.mdx | 0 .../globals/DOMException/DOMException.mdx | 0 .../globals/DOMException/code.mdx | 0 .../globals/DOMException/message.mdx | 0 .../globals/DOMException/name.mdx | 0 .../globals/DataView/DataView.mdx | 0 .../globals/DataView/prototype/buffer.mdx | 0 .../globals/DataView/prototype/byteLength.mdx | 0 .../globals/DataView/prototype/byteOffset.mdx | 0 .../DataView/prototype/getBigInt64.mdx | 0 .../DataView/prototype/getBigUint64.mdx | 0 .../globals/DataView/prototype/getFloat32.mdx | 0 .../globals/DataView/prototype/getFloat64.mdx | 0 .../globals/DataView/prototype/getInt16.mdx | 0 .../globals/DataView/prototype/getInt32.mdx | 0 .../globals/DataView/prototype/getInt8.mdx | 0 .../globals/DataView/prototype/getUint16.mdx | 0 .../globals/DataView/prototype/getUint32.mdx | 0 .../globals/DataView/prototype/getUint8.mdx | 0 .../DataView/prototype/setBigInt64.mdx | 0 .../DataView/prototype/setBigUint64.mdx | 0 .../globals/DataView/prototype/setFloat32.mdx | 0 .../globals/DataView/prototype/setFloat64.mdx | 0 .../globals/DataView/prototype/setInt16.mdx | 0 .../globals/DataView/prototype/setInt32.mdx | 0 .../globals/DataView/prototype/setInt8.mdx | 0 .../globals/DataView/prototype/setUint16.mdx | 0 .../globals/DataView/prototype/setUint32.mdx | 0 .../globals/DataView/prototype/setUint8.mdx | 0 .../globals/Date/Date.mdx | 0 .../globals/Date/UTC.mdx | 0 .../globals/Date/now.mdx | 0 .../globals/Date/parse.mdx | 0 .../globals/Date/prototype/@@toPrimitive.mdx | 0 .../globals/Date/prototype/getDate.mdx | 0 .../globals/Date/prototype/getDay.mdx | 0 .../globals/Date/prototype/getFullYear.mdx | 0 .../globals/Date/prototype/getHours.mdx | 0 .../Date/prototype/getMilliseconds.mdx | 0 .../globals/Date/prototype/getMinutes.mdx | 0 .../globals/Date/prototype/getMonth.mdx | 0 .../globals/Date/prototype/getSeconds.mdx | 0 .../globals/Date/prototype/getTime.mdx | 0 .../Date/prototype/getTimezoneOffset.mdx | 0 .../globals/Date/prototype/getUTCDate.mdx | 0 .../globals/Date/prototype/getUTCDay.mdx | 0 .../globals/Date/prototype/getUTCFullYear.mdx | 0 .../globals/Date/prototype/getUTCHours.mdx | 0 .../Date/prototype/getUTCMilliseconds.mdx | 0 .../globals/Date/prototype/getUTCMinutes.mdx | 0 .../globals/Date/prototype/getUTCMonth.mdx | 0 .../globals/Date/prototype/getUTCSeconds.mdx | 0 .../globals/Date/prototype/getYear.mdx | 0 .../globals/Date/prototype/setDate.mdx | 0 .../globals/Date/prototype/setFullYear.mdx | 0 .../globals/Date/prototype/setHours.mdx | 0 .../Date/prototype/setMilliseconds.mdx | 0 .../globals/Date/prototype/setMinutes.mdx | 0 .../globals/Date/prototype/setMonth.mdx | 0 .../globals/Date/prototype/setSeconds.mdx | 0 .../globals/Date/prototype/setTime.mdx | 0 .../globals/Date/prototype/setUTCDate.mdx | 0 .../globals/Date/prototype/setUTCFullYear.mdx | 0 .../globals/Date/prototype/setUTCHours.mdx | 0 .../Date/prototype/setUTCMilliseconds.mdx | 0 .../globals/Date/prototype/setUTCMinutes.mdx | 0 .../globals/Date/prototype/setUTCMonth.mdx | 0 .../globals/Date/prototype/setUTCSeconds.mdx | 0 .../globals/Date/prototype/setYear.mdx | 0 .../globals/Date/prototype/toDateString.mdx | 0 .../globals/Date/prototype/toISOString.mdx | 0 .../globals/Date/prototype/toJSON.mdx | 0 .../Date/prototype/toLocaleDateString.mdx | 0 .../globals/Date/prototype/toLocaleString.mdx | 0 .../Date/prototype/toLocaleTimeString.mdx | 0 .../globals/Date/prototype/toString.mdx | 0 .../globals/Date/prototype/toTimeString.mdx | 0 .../globals/Date/prototype/toUTCString.mdx | 0 .../globals/Date/prototype/valueOf.mdx | 0 .../DecompressionStream.mdx | 0 .../prototype/readable.mdx | 0 .../prototype/writable.mdx | 0 .../EcKeyImportParams/EcKeyImportParams.mdx | 0 .../globals/EcdsaParams/EcdsaParams.mdx | 0 .../globals/Error/Error.mdx | 0 .../globals/Error/prototype/cause.mdx | 0 .../globals/Error/prototype/message.mdx | 0 .../globals/Error/prototype/name.mdx | 0 .../globals/Error/prototype/toString.mdx | 0 .../globals/EvalError/EvalError.mdx | 0 .../globals/FetchEvent/FetchEvent.mdx | 0 .../FetchEvent/prototype/respondWith.mdx | 0 .../FetchEvent/prototype/waitUntil.mdx | 0 .../FinalizationRegistry.mdx | 0 .../prototype/register.mdx | 0 .../prototype/unregister.mdx | 0 .../globals/Float32Array/Float32Array.mdx | 0 .../globals/Float64Array/Float64Array.mdx | 0 .../globals/Function/Function.mdx | 0 .../globals/Function/prototype/apply.mdx | 0 .../globals/Function/prototype/bind.mdx | 0 .../globals/Function/prototype/call.mdx | 0 .../globals/Function/prototype/index.mdx | 0 .../globals/Function/prototype/length.mdx | 0 .../globals/Function/prototype/name.mdx | 0 .../globals/Function/prototype/toString.mdx | 0 .../globals/Headers/Headers.mdx | 0 .../globals/Headers/prototype/append.mdx | 0 .../globals/Headers/prototype/delete.mdx | 0 .../globals/Headers/prototype/entries.mdx | 0 .../globals/Headers/prototype/forEach.mdx | 0 .../globals/Headers/prototype/get.mdx | 0 .../globals/Headers/prototype/has.mdx | 0 .../globals/Headers/prototype/keys.mdx | 0 .../globals/Headers/prototype/set.mdx | 0 .../globals/Headers/prototype/values.mdx | 0 .../HmacImportParams/HmacImportParams.mdx | 0 .../globals/Infinity.mdx | 0 .../globals/Int16Array/Int16Array.mdx | 0 .../globals/Int32Array/Int32Array.mdx | 0 .../globals/Int8Array/Int8Array.mdx | 0 .../globals/JSON/parse.mdx | 0 .../globals/JSON/stringify.mdx | 0 .../globals/Map/@@species.mdx | 0 .../globals/Map/Map.mdx | 0 .../globals/Map/prototype/@@iterator.mdx | 0 .../globals/Map/prototype/clear.mdx | 0 .../globals/Map/prototype/delete.mdx | 0 .../globals/Map/prototype/entries.mdx | 0 .../globals/Map/prototype/forEach.mdx | 0 .../globals/Map/prototype/get.mdx | 0 .../globals/Map/prototype/has.mdx | 0 .../globals/Map/prototype/keys.mdx | 0 .../globals/Map/prototype/set.mdx | 0 .../globals/Map/prototype/size.mdx | 0 .../globals/Map/prototype/values.mdx | 0 .../globals/Math/E.mdx | 0 .../globals/Math/LN10.mdx | 0 .../globals/Math/LN2.mdx | 0 .../globals/Math/LOG10e.mdx | 0 .../globals/Math/LOG2e.mdx | 0 .../globals/Math/PI.mdx | 0 .../globals/Math/SQRT1_2.mdx | 0 .../globals/Math/SQRT2.mdx | 0 .../globals/Math/abs.mdx | 0 .../globals/Math/acos.mdx | 0 .../globals/Math/acosh.mdx | 0 .../globals/Math/asin.mdx | 0 .../globals/Math/asinh.mdx | 0 .../globals/Math/atan.mdx | 0 .../globals/Math/atan2.mdx | 0 .../globals/Math/atanh.mdx | 0 .../globals/Math/cbrt.mdx | 0 .../globals/Math/ceil.mdx | 0 .../globals/Math/clz32.mdx | 0 .../globals/Math/cos.mdx | 0 .../globals/Math/cosh.mdx | 0 .../globals/Math/exp.mdx | 0 .../globals/Math/expm1.mdx | 0 .../globals/Math/floor.mdx | 0 .../globals/Math/fround.mdx | 0 .../globals/Math/hypot.mdx | 0 .../globals/Math/imul.mdx | 0 .../globals/Math/log.mdx | 0 .../globals/Math/log10.mdx | 0 .../globals/Math/log1p.mdx | 0 .../globals/Math/log2.mdx | 0 .../globals/Math/max.mdx | 0 .../globals/Math/min.mdx | 0 .../globals/Math/pow.mdx | 0 .../globals/Math/random.mdx | 0 .../globals/Math/round.mdx | 0 .../globals/Math/sign.mdx | 0 .../globals/Math/sin.mdx | 0 .../globals/Math/sinh.mdx | 0 .../globals/Math/sqrt.mdx | 0 .../globals/Math/tan.mdx | 0 .../globals/Math/tanh.mdx | 0 .../globals/Math/trunc.mdx | 0 .../globals/NaN.mdx | 0 .../globals/Number/MAX_SAFE_INTEGER.mdx | 0 .../globals/Number/MAX_VALUE.mdx | 0 .../globals/Number/MIN_SAFE_INTEGER.mdx | 0 .../globals/Number/MIN_VALUE.mdx | 0 .../globals/Number/NEGATIVE_INFINITY.mdx | 0 .../globals/Number/NaN.mdx | 0 .../globals/Number/Number.mdx | 0 .../globals/Number/POSITIVE_INFINITY.mdx | 0 .../globals/Number/epsilon.mdx | 0 .../globals/Number/isFinite.mdx | 0 .../globals/Number/isInteger.mdx | 0 .../globals/Number/isNaN.mdx | 0 .../globals/Number/isSafeInteger.mdx | 0 .../globals/Number/parseFloat.mdx | 0 .../globals/Number/parseInt.mdx | 0 .../Number/prototype/toExponential.mdx | 0 .../globals/Number/prototype/toFixed.mdx | 0 .../Number/prototype/toLocaleString.mdx | 0 .../globals/Number/prototype/toPrecision.mdx | 0 .../globals/Number/prototype/toString.mdx | 0 .../globals/Number/prototype/valueOf.mdx | 0 .../globals/Object/Object.mdx | 0 .../globals/Object/assign.mdx | 0 .../globals/Object/create.mdx | 0 .../globals/Object/defineProperties.mdx | 0 .../globals/Object/defineProperty.mdx | 0 .../globals/Object/entries.mdx | 0 .../globals/Object/freeze.mdx | 0 .../globals/Object/fromEntries.mdx | 0 .../Object/getOwnPropertyDescriptor.mdx | 0 .../Object/getOwnPropertyDescriptors.mdx | 0 .../globals/Object/getOwnPropertyNames.mdx | 0 .../globals/Object/getOwnPropertySymbols.mdx | 0 .../globals/Object/getPrototypeOf.mdx | 0 .../globals/Object/hasOwn.mdx | 0 .../globals/Object/is.mdx | 0 .../globals/Object/isExtensible.mdx | 0 .../globals/Object/isFrozen.mdx | 0 .../globals/Object/isSealed.mdx | 0 .../globals/Object/keys.mdx | 0 .../globals/Object/preventExtensions.mdx | 0 .../globals/Object/prototype/constructor.mdx | 0 .../Object/prototype/hasOwnProperty.mdx | 0 .../Object/prototype/isPrototypeOf.mdx | 0 .../Object/prototype/propertyIsEnumerable.mdx | 0 .../Object/prototype/toLocaleString.mdx | 0 .../globals/Object/prototype/toString.mdx | 0 .../globals/Object/prototype/valueOf.mdx | 0 .../globals/Object/seal.mdx | 0 .../globals/Object/setPrototypeOf.mdx | 0 .../globals/Object/values.mdx | 0 .../globals/Promise/@@species.mdx | 0 .../globals/Promise/Promise.mdx | 0 .../globals/Promise/all.mdx | 0 .../globals/Promise/allSettled.mdx | 0 .../globals/Promise/any.mdx | 0 .../globals/Promise/prototype/catch.mdx | 0 .../globals/Promise/prototype/finally.mdx | 0 .../globals/Promise/prototype/then.mdx | 0 .../globals/Promise/race.mdx | 0 .../globals/Promise/reject.mdx | 0 .../globals/Promise/resolve.mdx | 0 .../globals/Proxy/Proxy.mdx | 0 .../globals/Proxy/proxy/apply.mdx | 0 .../globals/Proxy/proxy/construct.mdx | 0 .../globals/Proxy/proxy/defineProperty.mdx | 0 .../globals/Proxy/proxy/deleteProperty.mdx | 0 .../globals/Proxy/proxy/get.mdx | 0 .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 0 .../globals/Proxy/proxy/getPrototypeOf.mdx | 0 .../globals/Proxy/proxy/has.mdx | 0 .../globals/Proxy/proxy/isExtensible.mdx | 0 .../globals/Proxy/proxy/ownKeys.mdx | 0 .../globals/Proxy/proxy/preventExtensions.mdx | 0 .../globals/Proxy/proxy/set.mdx | 0 .../globals/Proxy/proxy/setPrototypeOf.mdx | 0 .../globals/Proxy/revocable.mdx | 0 .../globals/RangeError/RangeError.mdx | 0 .../prototype/byobRequest.mdx | 0 .../prototype/close.mdx | 0 .../prototype/desiredSize.mdx | 0 .../prototype/enqueue.mdx | 0 .../prototype/error.mdx | 0 .../globals/ReadableStream/ReadableStream.mdx | 0 .../ReadableStream/prototype/cancel.mdx | 0 .../ReadableStream/prototype/getReader.mdx | 0 .../ReadableStream/prototype/locked.mdx | 0 .../ReadableStream/prototype/pipeThrough.mdx | 0 .../ReadableStream/prototype/pipeTo.mdx | 0 .../globals/ReadableStream/prototype/tee.mdx | 0 .../ReadableStreamBYOBReader.mdx | 0 .../prototype/cancel.mdx | 0 .../prototype/closed.mdx | 0 .../prototype/read.mdx | 0 .../prototype/releaseLock.mdx | 0 .../prototype/respond.mdx | 0 .../prototype/respondWithNewView.mdx | 0 .../prototype/view.mdx | 0 .../prototype/close.mdx | 0 .../prototype/desiredSize.mdx | 0 .../prototype/enqueue.mdx | 0 .../prototype/error.mdx | 0 .../ReadableStreamDefaultReader.mdx | 0 .../prototype/cancel.mdx | 0 .../prototype/closed.mdx | 0 .../prototype/read.mdx | 0 .../prototype/releaseLock.mdx | 0 .../globals/ReferenceError/ReferenceError.mdx | 0 .../globals/Reflect/apply.mdx | 0 .../globals/Reflect/construct.mdx | 0 .../globals/Reflect/defineProperty.mdx | 0 .../globals/Reflect/deleteProperty.mdx | 0 .../globals/Reflect/get.mdx | 0 .../Reflect/getOwnPropertyDescriptor.mdx | 0 .../globals/Reflect/getPrototypeOf.mdx | 0 .../globals/Reflect/has.mdx | 0 .../globals/Reflect/isExtensible.mdx | 0 .../globals/Reflect/ownKeys.mdx | 0 .../globals/Reflect/preventExtensions.mdx | 0 .../globals/Reflect/set.mdx | 0 .../globals/Reflect/setPrototypeOf.mdx | 0 .../globals/Request/Request.mdx | 0 .../globals/Request/prototype/arrayBuffer.mdx | 0 .../globals/Request/prototype/body.mdx | 0 .../globals/Request/prototype/bodyUsed.mdx | 0 .../globals/Request/prototype/clone.mdx | 0 .../globals/Request/prototype/headers.mdx | 0 .../globals/Request/prototype/json.mdx | 0 .../globals/Request/prototype/method.mdx | 0 .../prototype/setManualFramingHeaders.mdx | 0 .../globals/Request/prototype/text.mdx | 0 .../globals/Request/prototype/url.mdx | 0 .../globals/Response/Response.mdx | 0 .../Response/prototype/arrayBuffer.mdx | 0 .../globals/Response/prototype/body.mdx | 0 .../globals/Response/prototype/bodyUsed.mdx | 0 .../globals/Response/prototype/headers.mdx | 0 .../globals/Response/prototype/json.mdx | 0 .../globals/Response/prototype/ok.mdx | 0 .../globals/Response/prototype/status.mdx | 0 .../globals/Response/prototype/statusText.mdx | 0 .../globals/Response/prototype/text.mdx | 0 .../globals/Response/prototype/url.mdx | 0 .../globals/Response/redirect.mdx | 0 .../Response/setManualFramingHeaders.mdx | 0 .../RsaHashedImportParams.mdx | 0 .../globals/Set/@@species.mdx | 0 .../globals/Set/Set.mdx | 0 .../globals/Set/prototype/@@iterator.mdx | 0 .../globals/Set/prototype/add.mdx | 0 .../globals/Set/prototype/clear.mdx | 0 .../globals/Set/prototype/delete.mdx | 0 .../globals/Set/prototype/entries.mdx | 0 .../globals/Set/prototype/forEach.mdx | 0 .../globals/Set/prototype/has.mdx | 0 .../globals/Set/prototype/keys.mdx | 0 .../globals/Set/prototype/size.mdx | 0 .../globals/Set/prototype/values.mdx | 0 .../globals/String/String.mdx | 0 .../globals/String/fromCharCode.mdx | 0 .../globals/String/fromCodePoint.mdx | 0 .../globals/String/prototype/@@iterator.mdx | 0 .../globals/String/prototype/at.mdx | 0 .../globals/String/prototype/charAt.mdx | 0 .../globals/String/prototype/charCodeAt.mdx | 0 .../globals/String/prototype/codePointAt.mdx | 0 .../globals/String/prototype/concat.mdx | 0 .../globals/String/prototype/endsWith.mdx | 0 .../globals/String/prototype/includes.mdx | 0 .../globals/String/prototype/indexOf.mdx | 0 .../globals/String/prototype/lastIndexOf.mdx | 0 .../globals/String/prototype/length.mdx | 0 .../String/prototype/localeCompare.mdx | 0 .../globals/String/prototype/match.mdx | 0 .../globals/String/prototype/matchAll.mdx | 0 .../globals/String/prototype/padEnd.mdx | 0 .../globals/String/prototype/padStart.mdx | 0 .../globals/String/prototype/repeat.mdx | 0 .../globals/String/prototype/replace.mdx | 0 .../globals/String/prototype/replaceAll.mdx | 0 .../globals/String/prototype/search.mdx | 0 .../globals/String/prototype/slice.mdx | 0 .../globals/String/prototype/split.mdx | 0 .../globals/String/prototype/startsWith.mdx | 0 .../globals/String/prototype/substr.mdx | 0 .../globals/String/prototype/substring.mdx | 0 .../String/prototype/toLocaleLowerCase.mdx | 0 .../String/prototype/toLocaleUpperCase.mdx | 0 .../globals/String/prototype/toLowerCase.mdx | 0 .../globals/String/prototype/toString.mdx | 0 .../globals/String/prototype/toUpperCase.mdx | 0 .../globals/String/prototype/trim.mdx | 0 .../globals/String/prototype/trimEnd.mdx | 0 .../globals/String/prototype/trimStart.mdx | 0 .../globals/String/prototype/valueOf.mdx | 0 .../globals/String/raw.mdx | 0 .../globals/SubtleCrypto/SubtleCrypto.mdx | 0 .../globals/SubtleCrypto/prototype/digest.mdx | 0 .../SubtleCrypto/prototype/importKey.mdx | 0 .../globals/SubtleCrypto/prototype/sign.mdx | 0 .../globals/SubtleCrypto/prototype/verify.mdx | 0 .../globals/Symbol/Symbol.mdx | 0 .../globals/Symbol/asyncIterator.mdx | 0 .../globals/Symbol/for.mdx | 0 .../globals/Symbol/hasInstance.mdx | 0 .../globals/Symbol/isConcatSpreadable.mdx | 0 .../globals/Symbol/iterator.mdx | 0 .../globals/Symbol/keyFor.mdx | 0 .../globals/Symbol/match.mdx | 0 .../globals/Symbol/matchAll.mdx | 0 .../Symbol/prototype/@@toPrimitive.mdx | 0 .../globals/Symbol/prototype/description.mdx | 0 .../globals/Symbol/prototype/toString.mdx | 0 .../globals/Symbol/prototype/valueOf.mdx | 0 .../globals/Symbol/replace.mdx | 0 .../globals/Symbol/search.mdx | 0 .../globals/Symbol/species.mdx | 0 .../globals/Symbol/split.mdx | 0 .../globals/Symbol/toPrimitive.mdx | 0 .../globals/Symbol/toStringTag.mdx | 0 .../globals/Symbol/unscopables.mdx | 0 .../globals/SyntaxError/SyntaxError.mdx | 0 .../globals/TextDecoder/TextDecoder.mdx | 0 .../globals/TextDecoder/prototype/decode.mdx | 0 .../TextDecoder/prototype/encoding.mdx | 0 .../globals/TextDecoder/prototype/fatal.mdx | 0 .../TextDecoder/prototype/ignoreBOM.mdx | 0 .../globals/TextEncoder/TextEncoder.mdx | 0 .../globals/TextEncoder/prototype/encode.mdx | 0 .../TextEncoder/prototype/encoding.mdx | 0 .../TransformStream/TransformStream.mdx | 0 .../TransformStream/prototype/readable.mdx | 0 .../TransformStream/prototype/writable.mdx | 0 .../prototype/desiredSize.mdx | 0 .../prototype/enqueue.mdx | 0 .../prototype/error.mdx | 0 .../prototype/terminate.mdx | 0 .../globals/TypeError/TypeError.mdx | 0 .../globals/URIError/URIError.mdx | 0 .../globals/URL/URL.mdx | 0 .../globals/URL/prototype/hash.mdx | 0 .../globals/URL/prototype/host.mdx | 0 .../globals/URL/prototype/hostname.mdx | 0 .../globals/URL/prototype/href.mdx | 0 .../globals/URL/prototype/origin.mdx | 0 .../globals/URL/prototype/password.mdx | 0 .../globals/URL/prototype/pathname.mdx | 0 .../globals/URL/prototype/port.mdx | 0 .../globals/URL/prototype/protocol.mdx | 0 .../globals/URL/prototype/search.mdx | 0 .../globals/URL/prototype/searchParams.mdx | 0 .../globals/URL/prototype/toJSON.mdx | 0 .../globals/URL/prototype/toString.mdx | 0 .../globals/URL/prototype/username.mdx | 0 .../URLSearchParams/URLSearchParams.mdx | 0 .../URLSearchParams/prototype/append.mdx | 0 .../URLSearchParams/prototype/delete.mdx | 0 .../URLSearchParams/prototype/entries.mdx | 0 .../URLSearchParams/prototype/forEach.mdx | 0 .../globals/URLSearchParams/prototype/get.mdx | 0 .../globals/URLSearchParams/prototype/has.mdx | 0 .../URLSearchParams/prototype/keys.mdx | 0 .../globals/URLSearchParams/prototype/set.mdx | 0 .../URLSearchParams/prototype/sort.mdx | 0 .../URLSearchParams/prototype/toString.mdx | 0 .../URLSearchParams/prototype/values.mdx | 0 .../globals/Uint16Array/Uint16Array.mdx | 0 .../globals/Uint32Array/Uint32Array.mdx | 0 .../globals/Uint8Array/Uint8Array.mdx | 0 .../Uint8ClampedArray/Uint8ClampedArray.mdx | 0 .../globals/WeakMap/WeakMap.mdx | 0 .../globals/WeakMap/prototype/delete.mdx | 0 .../globals/WeakMap/prototype/get.mdx | 0 .../globals/WeakMap/prototype/has.mdx | 0 .../globals/WeakMap/prototype/set.mdx | 0 .../globals/WeakRef/WeakRef.mdx | 0 .../globals/WeakRef/prototype/deref.mdx | 0 .../globals/WeakSet/WeakSet.mdx | 0 .../globals/WeakSet/prototype/add.mdx | 0 .../globals/WeakSet/prototype/delete.mdx | 0 .../globals/WeakSet/prototype/has.mdx | 0 .../globals/WorkerLocation/WorkerLocation.mdx | 0 .../globals/WorkerLocation/hash.mdx | 0 .../globals/WorkerLocation/host.mdx | 0 .../globals/WorkerLocation/hostname.mdx | 0 .../globals/WorkerLocation/href.mdx | 0 .../globals/WorkerLocation/origin.mdx | 0 .../globals/WorkerLocation/pathname.mdx | 0 .../globals/WorkerLocation/port.mdx | 0 .../globals/WorkerLocation/protocol.mdx | 0 .../globals/WorkerLocation/search.mdx | 0 .../globals/WorkerLocation/toString.mdx | 0 .../globals/WritableStream/WritableStream.mdx | 0 .../WritableStream/prototype/abort.mdx | 0 .../WritableStream/prototype/getWriter.mdx | 0 .../WritableStream/prototype/locked.mdx | 0 .../WritableStreamDefaultController/error.mdx | 0 .../WritableStreamDefaultWriter.mdx | 0 .../prototype/abort.mdx | 0 .../prototype/close.mdx | 0 .../prototype/closed.mdx | 0 .../prototype/desiredSize.mdx | 0 .../prototype/ready.mdx | 0 .../prototype/releaseLock.mdx | 0 .../prototype/write.mdx | 0 .../globals/atob.mdx | 0 .../globals/btoa.mdx | 0 .../globals/clearInterval.mdx | 0 .../globals/clearTimeout.mdx | 0 .../globals/console/assert.mdx | 0 .../globals/console/clear.mdx | 0 .../globals/console/count.mdx | 0 .../globals/console/countReset.mdx | 0 .../globals/console/debug.mdx | 0 .../globals/console/dir.mdx | 0 .../globals/console/dirxml.mdx | 0 .../globals/console/error.mdx | 0 .../globals/console/group.mdx | 0 .../globals/console/groupCollapsed.mdx | 0 .../globals/console/groupEnd.mdx | 0 .../globals/console/info.mdx | 0 .../globals/console/log.mdx | 0 .../globals/console/time.mdx | 0 .../globals/console/timeEnd.mdx | 0 .../globals/console/timeLog.mdx | 0 .../globals/console/trace.mdx | 0 .../globals/console/warn.mdx | 0 .../globals/crypto/getRandomValues.mdx | 0 .../globals/crypto/randomUUID.mdx | 0 .../globals/crypto/subtle.mdx | 0 .../globals/decodeURI.mdx | 0 .../globals/decodeURIComponent.mdx | 0 .../globals/encodeURI.mdx | 0 .../globals/encodeURIComponent.mdx | 0 .../globals/escape.mdx | 0 .../globals/eval.mdx | 0 .../globals/fetch.mdx | 0 .../globals/globalThis.mdx | 0 .../globals/isFinite.mdx | 0 .../globals/isNaN.mdx | 0 .../globals/location.mdx | 0 .../globals/parseFloat.mdx | 0 .../globals/parseInt.mdx | 0 .../globals/performance/now.mdx | 0 .../globals/performance/timeOrigin.mdx | 0 .../globals/setInterval.mdx | 0 .../globals/setTimeout.mdx | 0 .../globals/structuredClone.mdx | 0 .../globals/undefined.mdx | 0 .../globals/unescape.mdx | 0 .../index.mdx | 0 .../migration-guide/index.mdx | 0 .../fastly:backend/Backend/Backend.mdx | 227 ------------------ .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 47 ---- .../fastly:cache/SimpleCache/get.mdx | 65 ----- .../fastly:cache/SimpleCache/getOrSet.mdx | 81 ------- .../fastly:cache/SimpleCache/purge.mdx | 81 ------- .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-3.2.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-3.2.0/globals/Array/@@species.mdx | 57 ----- .../version-3.2.0/globals/Array/Array.mdx | 41 ---- .../version-3.2.0/globals/Array/from.mdx | 62 ----- .../version-3.2.0/globals/Array/isArray.mdx | 32 --- .../version-3.2.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-3.2.0/globals/BigInt/BigInt.mdx | 37 --- .../version-3.2.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-3.2.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-3.2.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DOMException/DOMException.mdx | 107 --------- .../globals/DOMException/code.mdx | 16 -- .../globals/DOMException/message.mdx | 14 -- .../globals/DOMException/name.mdx | 14 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-3.2.0/globals/Date/Date.mdx | 88 ------- .../version-3.2.0/globals/Date/UTC.mdx | 84 ------- .../version-3.2.0/globals/Date/now.mdx | 19 -- .../version-3.2.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-3.2.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 28 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-3.2.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../HmacImportParams/HmacImportParams.mdx | 21 -- .../version-3.2.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-3.2.0/globals/JSON/parse.mdx | 50 ---- .../version-3.2.0/globals/JSON/stringify.mdx | 96 -------- .../version-3.2.0/globals/Map/@@species.mdx | 25 -- .../version-3.2.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-3.2.0/globals/Math/E.mdx | 17 -- .../version-3.2.0/globals/Math/LN10.mdx | 17 -- .../version-3.2.0/globals/Math/LN2.mdx | 17 -- .../version-3.2.0/globals/Math/LOG10e.mdx | 17 -- .../version-3.2.0/globals/Math/LOG2e.mdx | 17 -- .../version-3.2.0/globals/Math/PI.mdx | 17 -- .../version-3.2.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-3.2.0/globals/Math/SQRT2.mdx | 19 -- .../version-3.2.0/globals/Math/abs.mdx | 29 --- .../version-3.2.0/globals/Math/acos.mdx | 28 --- .../version-3.2.0/globals/Math/acosh.mdx | 28 --- .../version-3.2.0/globals/Math/asin.mdx | 28 --- .../version-3.2.0/globals/Math/asinh.mdx | 28 --- .../version-3.2.0/globals/Math/atan.mdx | 28 --- .../version-3.2.0/globals/Math/atan2.mdx | 51 ---- .../version-3.2.0/globals/Math/atanh.mdx | 29 --- .../version-3.2.0/globals/Math/cbrt.mdx | 28 --- .../version-3.2.0/globals/Math/ceil.mdx | 28 --- .../version-3.2.0/globals/Math/clz32.mdx | 34 --- .../version-3.2.0/globals/Math/cos.mdx | 28 --- .../version-3.2.0/globals/Math/cosh.mdx | 28 --- .../version-3.2.0/globals/Math/exp.mdx | 30 --- .../version-3.2.0/globals/Math/expm1.mdx | 32 --- .../version-3.2.0/globals/Math/floor.mdx | 28 --- .../version-3.2.0/globals/Math/fround.mdx | 32 --- .../version-3.2.0/globals/Math/hypot.mdx | 39 --- .../version-3.2.0/globals/Math/imul.mdx | 35 --- .../version-3.2.0/globals/Math/log.mdx | 32 --- .../version-3.2.0/globals/Math/log10.mdx | 30 --- .../version-3.2.0/globals/Math/log1p.mdx | 34 --- .../version-3.2.0/globals/Math/log2.mdx | 30 --- .../version-3.2.0/globals/Math/max.mdx | 33 --- .../version-3.2.0/globals/Math/min.mdx | 33 --- .../version-3.2.0/globals/Math/pow.mdx | 39 --- .../version-3.2.0/globals/Math/random.mdx | 21 -- .../version-3.2.0/globals/Math/round.mdx | 34 --- .../version-3.2.0/globals/Math/sign.mdx | 34 --- .../version-3.2.0/globals/Math/sin.mdx | 28 --- .../version-3.2.0/globals/Math/sinh.mdx | 29 --- .../version-3.2.0/globals/Math/sqrt.mdx | 29 --- .../version-3.2.0/globals/Math/tan.mdx | 31 --- .../version-3.2.0/globals/Math/tanh.mdx | 28 --- .../version-3.2.0/globals/Math/trunc.mdx | 30 --- .../version-3.2.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-3.2.0/globals/Number/NaN.mdx | 17 -- .../version-3.2.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-3.2.0/globals/Number/epsilon.mdx | 21 -- .../version-3.2.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-3.2.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-3.2.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-3.2.0/globals/Object/Object.mdx | 27 --- .../version-3.2.0/globals/Object/assign.mdx | 57 ----- .../version-3.2.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-3.2.0/globals/Object/entries.mdx | 30 --- .../version-3.2.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-3.2.0/globals/Object/hasOwn.mdx | 46 ---- .../version-3.2.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-3.2.0/globals/Object/isFrozen.mdx | 31 --- .../version-3.2.0/globals/Object/isSealed.mdx | 32 --- .../version-3.2.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-3.2.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-3.2.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-3.2.0/globals/Promise/Promise.mdx | 140 ----------- .../version-3.2.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-3.2.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-3.2.0/globals/Promise/race.mdx | 30 --- .../version-3.2.0/globals/Promise/reject.mdx | 32 --- .../version-3.2.0/globals/Promise/resolve.mdx | 39 --- .../version-3.2.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-3.2.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-3.2.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-3.2.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-3.2.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-3.2.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-3.2.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-3.2.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-3.2.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-3.2.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-3.2.0/globals/Request/Request.mdx | 46 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 18 -- .../version-3.2.0/globals/Set/@@species.mdx | 25 -- .../version-3.2.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-3.2.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-3.2.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 97 -------- .../globals/SubtleCrypto/prototype/sign.mdx | 60 ----- .../globals/SubtleCrypto/prototype/verify.mdx | 52 ---- .../version-3.2.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-3.2.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-3.2.0/globals/Symbol/iterator.mdx | 26 -- .../version-3.2.0/globals/Symbol/keyFor.mdx | 25 -- .../version-3.2.0/globals/Symbol/match.mdx | 19 -- .../version-3.2.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-3.2.0/globals/Symbol/replace.mdx | 15 -- .../version-3.2.0/globals/Symbol/search.mdx | 15 -- .../version-3.2.0/globals/Symbol/species.mdx | 21 -- .../version-3.2.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-3.2.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-3.2.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-3.2.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-3.2.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-3.2.0/globals/atob.mdx | 37 --- .../version-3.2.0/globals/btoa.mdx | 38 --- .../version-3.2.0/globals/clearInterval.mdx | 35 --- .../version-3.2.0/globals/clearTimeout.mdx | 36 --- .../version-3.2.0/globals/console/assert.mdx | 42 ---- .../version-3.2.0/globals/console/clear.mdx | 24 -- .../version-3.2.0/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-3.2.0/globals/console/debug.mdx | 26 -- .../version-3.2.0/globals/console/dir.mdx | 26 -- .../version-3.2.0/globals/console/dirxml.mdx | 25 -- .../version-3.2.0/globals/console/error.mdx | 26 -- .../version-3.2.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-3.2.0/globals/console/info.mdx | 26 -- .../version-3.2.0/globals/console/log.mdx | 30 --- .../version-3.2.0/globals/console/time.mdx | 29 --- .../version-3.2.0/globals/console/timeEnd.mdx | 26 -- .../version-3.2.0/globals/console/timeLog.mdx | 26 -- .../version-3.2.0/globals/console/trace.mdx | 27 --- .../version-3.2.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-3.2.0/globals/crypto/subtle.mdx | 16 -- .../version-3.2.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-3.2.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-3.2.0/globals/escape.mdx | 34 --- .../version-3.2.0/globals/eval.mdx | 36 --- .../version-3.2.0/globals/globalThis.mdx | 20 -- .../version-3.2.0/globals/isFinite.mdx | 37 --- .../version-3.2.0/globals/isNaN.mdx | 36 --- .../version-3.2.0/globals/location.mdx | 18 -- .../version-3.2.0/globals/parseFloat.mdx | 41 ---- .../version-3.2.0/globals/parseInt.mdx | 68 ------ .../version-3.2.0/globals/performance/now.mdx | 25 -- .../globals/performance/timeOrigin.mdx | 16 -- .../version-3.2.0/globals/setInterval.mdx | 61 ----- .../version-3.2.0/globals/setTimeout.mdx | 61 ----- .../version-3.2.0/globals/structuredClone.mdx | 33 --- .../version-3.2.0/globals/undefined.mdx | 25 -- .../version-3.2.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-3.2.0/index.mdx | 98 -------- .../version-3.2.0/migration-guide/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 227 ------------------ .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 47 ---- .../fastly:cache/SimpleCache/get.mdx | 65 ----- .../fastly:cache/SimpleCache/getOrSet.mdx | 81 ------- .../fastly:cache/SimpleCache/purge.mdx | 81 ------- .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-3.3.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-3.3.0/globals/Array/@@species.mdx | 57 ----- .../version-3.3.0/globals/Array/Array.mdx | 41 ---- .../version-3.3.0/globals/Array/from.mdx | 62 ----- .../version-3.3.0/globals/Array/isArray.mdx | 32 --- .../version-3.3.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-3.3.0/globals/BigInt/BigInt.mdx | 37 --- .../version-3.3.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-3.3.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-3.3.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DOMException/DOMException.mdx | 107 --------- .../globals/DOMException/code.mdx | 16 -- .../globals/DOMException/message.mdx | 14 -- .../globals/DOMException/name.mdx | 14 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-3.3.0/globals/Date/Date.mdx | 88 ------- .../version-3.3.0/globals/Date/UTC.mdx | 84 ------- .../version-3.3.0/globals/Date/now.mdx | 19 -- .../version-3.3.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-3.3.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-3.3.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../HmacImportParams/HmacImportParams.mdx | 21 -- .../version-3.3.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-3.3.0/globals/JSON/parse.mdx | 50 ---- .../version-3.3.0/globals/JSON/stringify.mdx | 96 -------- .../version-3.3.0/globals/Map/@@species.mdx | 25 -- .../version-3.3.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-3.3.0/globals/Math/E.mdx | 17 -- .../version-3.3.0/globals/Math/LN10.mdx | 17 -- .../version-3.3.0/globals/Math/LN2.mdx | 17 -- .../version-3.3.0/globals/Math/LOG10e.mdx | 17 -- .../version-3.3.0/globals/Math/LOG2e.mdx | 17 -- .../version-3.3.0/globals/Math/PI.mdx | 17 -- .../version-3.3.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-3.3.0/globals/Math/SQRT2.mdx | 19 -- .../version-3.3.0/globals/Math/abs.mdx | 29 --- .../version-3.3.0/globals/Math/acos.mdx | 28 --- .../version-3.3.0/globals/Math/acosh.mdx | 28 --- .../version-3.3.0/globals/Math/asin.mdx | 28 --- .../version-3.3.0/globals/Math/asinh.mdx | 28 --- .../version-3.3.0/globals/Math/atan.mdx | 28 --- .../version-3.3.0/globals/Math/atan2.mdx | 51 ---- .../version-3.3.0/globals/Math/atanh.mdx | 29 --- .../version-3.3.0/globals/Math/cbrt.mdx | 28 --- .../version-3.3.0/globals/Math/ceil.mdx | 28 --- .../version-3.3.0/globals/Math/clz32.mdx | 34 --- .../version-3.3.0/globals/Math/cos.mdx | 28 --- .../version-3.3.0/globals/Math/cosh.mdx | 28 --- .../version-3.3.0/globals/Math/exp.mdx | 30 --- .../version-3.3.0/globals/Math/expm1.mdx | 32 --- .../version-3.3.0/globals/Math/floor.mdx | 28 --- .../version-3.3.0/globals/Math/fround.mdx | 32 --- .../version-3.3.0/globals/Math/hypot.mdx | 39 --- .../version-3.3.0/globals/Math/imul.mdx | 35 --- .../version-3.3.0/globals/Math/log.mdx | 32 --- .../version-3.3.0/globals/Math/log10.mdx | 30 --- .../version-3.3.0/globals/Math/log1p.mdx | 34 --- .../version-3.3.0/globals/Math/log2.mdx | 30 --- .../version-3.3.0/globals/Math/max.mdx | 33 --- .../version-3.3.0/globals/Math/min.mdx | 33 --- .../version-3.3.0/globals/Math/pow.mdx | 39 --- .../version-3.3.0/globals/Math/random.mdx | 21 -- .../version-3.3.0/globals/Math/round.mdx | 34 --- .../version-3.3.0/globals/Math/sign.mdx | 34 --- .../version-3.3.0/globals/Math/sin.mdx | 28 --- .../version-3.3.0/globals/Math/sinh.mdx | 29 --- .../version-3.3.0/globals/Math/sqrt.mdx | 29 --- .../version-3.3.0/globals/Math/tan.mdx | 31 --- .../version-3.3.0/globals/Math/tanh.mdx | 28 --- .../version-3.3.0/globals/Math/trunc.mdx | 30 --- .../version-3.3.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-3.3.0/globals/Number/NaN.mdx | 17 -- .../version-3.3.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-3.3.0/globals/Number/epsilon.mdx | 21 -- .../version-3.3.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-3.3.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-3.3.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-3.3.0/globals/Object/Object.mdx | 27 --- .../version-3.3.0/globals/Object/assign.mdx | 57 ----- .../version-3.3.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-3.3.0/globals/Object/entries.mdx | 30 --- .../version-3.3.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-3.3.0/globals/Object/hasOwn.mdx | 46 ---- .../version-3.3.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-3.3.0/globals/Object/isFrozen.mdx | 31 --- .../version-3.3.0/globals/Object/isSealed.mdx | 32 --- .../version-3.3.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-3.3.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-3.3.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-3.3.0/globals/Promise/Promise.mdx | 140 ----------- .../version-3.3.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-3.3.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-3.3.0/globals/Promise/race.mdx | 30 --- .../version-3.3.0/globals/Promise/reject.mdx | 32 --- .../version-3.3.0/globals/Promise/resolve.mdx | 39 --- .../version-3.3.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-3.3.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-3.3.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-3.3.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-3.3.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-3.3.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-3.3.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-3.3.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-3.3.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-3.3.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-3.3.0/globals/Request/Request.mdx | 46 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 18 -- .../version-3.3.0/globals/Set/@@species.mdx | 25 -- .../version-3.3.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-3.3.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-3.3.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 97 -------- .../globals/SubtleCrypto/prototype/sign.mdx | 60 ----- .../globals/SubtleCrypto/prototype/verify.mdx | 52 ---- .../version-3.3.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-3.3.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-3.3.0/globals/Symbol/iterator.mdx | 26 -- .../version-3.3.0/globals/Symbol/keyFor.mdx | 25 -- .../version-3.3.0/globals/Symbol/match.mdx | 19 -- .../version-3.3.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-3.3.0/globals/Symbol/replace.mdx | 15 -- .../version-3.3.0/globals/Symbol/search.mdx | 15 -- .../version-3.3.0/globals/Symbol/species.mdx | 21 -- .../version-3.3.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-3.3.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-3.3.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-3.3.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-3.3.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-3.3.0/globals/atob.mdx | 37 --- .../version-3.3.0/globals/btoa.mdx | 38 --- .../version-3.3.0/globals/clearInterval.mdx | 35 --- .../version-3.3.0/globals/clearTimeout.mdx | 36 --- .../version-3.3.0/globals/console/assert.mdx | 42 ---- .../version-3.3.0/globals/console/clear.mdx | 24 -- .../version-3.3.0/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-3.3.0/globals/console/debug.mdx | 26 -- .../version-3.3.0/globals/console/dir.mdx | 26 -- .../version-3.3.0/globals/console/dirxml.mdx | 25 -- .../version-3.3.0/globals/console/error.mdx | 26 -- .../version-3.3.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-3.3.0/globals/console/info.mdx | 26 -- .../version-3.3.0/globals/console/log.mdx | 30 --- .../version-3.3.0/globals/console/time.mdx | 29 --- .../version-3.3.0/globals/console/timeEnd.mdx | 26 -- .../version-3.3.0/globals/console/timeLog.mdx | 26 -- .../version-3.3.0/globals/console/trace.mdx | 27 --- .../version-3.3.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-3.3.0/globals/crypto/subtle.mdx | 16 -- .../version-3.3.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-3.3.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-3.3.0/globals/escape.mdx | 34 --- .../version-3.3.0/globals/eval.mdx | 36 --- .../version-3.3.0/globals/fetch.mdx | 65 ----- .../version-3.3.0/globals/globalThis.mdx | 20 -- .../version-3.3.0/globals/isFinite.mdx | 37 --- .../version-3.3.0/globals/isNaN.mdx | 36 --- .../version-3.3.0/globals/location.mdx | 18 -- .../version-3.3.0/globals/parseFloat.mdx | 41 ---- .../version-3.3.0/globals/parseInt.mdx | 68 ------ .../version-3.3.0/globals/performance/now.mdx | 25 -- .../globals/performance/timeOrigin.mdx | 16 -- .../version-3.3.0/globals/setInterval.mdx | 61 ----- .../version-3.3.0/globals/setTimeout.mdx | 61 ----- .../version-3.3.0/globals/structuredClone.mdx | 33 --- .../version-3.3.0/globals/undefined.mdx | 25 -- .../version-3.3.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-3.3.0/index.mdx | 98 -------- .../version-3.3.0/migration-guide/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 227 ------------------ .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 47 ---- .../fastly:cache/SimpleCache/get.mdx | 65 ----- .../fastly:cache/SimpleCache/getOrSet.mdx | 81 ------- .../fastly:cache/SimpleCache/purge.mdx | 81 ------- .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-3.3.2/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-3.3.2/globals/Array/@@species.mdx | 57 ----- .../version-3.3.2/globals/Array/Array.mdx | 41 ---- .../version-3.3.2/globals/Array/from.mdx | 62 ----- .../version-3.3.2/globals/Array/isArray.mdx | 32 --- .../version-3.3.2/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-3.3.2/globals/BigInt/BigInt.mdx | 37 --- .../version-3.3.2/globals/BigInt/asIntN.mdx | 53 ---- .../version-3.3.2/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-3.3.2/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DOMException/DOMException.mdx | 107 --------- .../globals/DOMException/code.mdx | 16 -- .../globals/DOMException/message.mdx | 14 -- .../globals/DOMException/name.mdx | 14 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-3.3.2/globals/Date/Date.mdx | 88 ------- .../version-3.3.2/globals/Date/UTC.mdx | 84 ------- .../version-3.3.2/globals/Date/now.mdx | 19 -- .../version-3.3.2/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../version-3.3.2/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 38 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-3.3.2/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../HmacImportParams/HmacImportParams.mdx | 21 -- .../version-3.3.2/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-3.3.2/globals/JSON/parse.mdx | 50 ---- .../version-3.3.2/globals/JSON/stringify.mdx | 96 -------- .../version-3.3.2/globals/Map/@@species.mdx | 25 -- .../version-3.3.2/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-3.3.2/globals/Math/E.mdx | 17 -- .../version-3.3.2/globals/Math/LN10.mdx | 17 -- .../version-3.3.2/globals/Math/LN2.mdx | 17 -- .../version-3.3.2/globals/Math/LOG10e.mdx | 17 -- .../version-3.3.2/globals/Math/LOG2e.mdx | 17 -- .../version-3.3.2/globals/Math/PI.mdx | 17 -- .../version-3.3.2/globals/Math/SQRT1_2.mdx | 19 -- .../version-3.3.2/globals/Math/SQRT2.mdx | 19 -- .../version-3.3.2/globals/Math/abs.mdx | 29 --- .../version-3.3.2/globals/Math/acos.mdx | 28 --- .../version-3.3.2/globals/Math/acosh.mdx | 28 --- .../version-3.3.2/globals/Math/asin.mdx | 28 --- .../version-3.3.2/globals/Math/asinh.mdx | 28 --- .../version-3.3.2/globals/Math/atan.mdx | 28 --- .../version-3.3.2/globals/Math/atan2.mdx | 51 ---- .../version-3.3.2/globals/Math/atanh.mdx | 29 --- .../version-3.3.2/globals/Math/cbrt.mdx | 28 --- .../version-3.3.2/globals/Math/ceil.mdx | 28 --- .../version-3.3.2/globals/Math/clz32.mdx | 34 --- .../version-3.3.2/globals/Math/cos.mdx | 28 --- .../version-3.3.2/globals/Math/cosh.mdx | 28 --- .../version-3.3.2/globals/Math/exp.mdx | 30 --- .../version-3.3.2/globals/Math/expm1.mdx | 32 --- .../version-3.3.2/globals/Math/floor.mdx | 28 --- .../version-3.3.2/globals/Math/fround.mdx | 32 --- .../version-3.3.2/globals/Math/hypot.mdx | 39 --- .../version-3.3.2/globals/Math/imul.mdx | 35 --- .../version-3.3.2/globals/Math/log.mdx | 32 --- .../version-3.3.2/globals/Math/log10.mdx | 30 --- .../version-3.3.2/globals/Math/log1p.mdx | 34 --- .../version-3.3.2/globals/Math/log2.mdx | 30 --- .../version-3.3.2/globals/Math/max.mdx | 33 --- .../version-3.3.2/globals/Math/min.mdx | 33 --- .../version-3.3.2/globals/Math/pow.mdx | 39 --- .../version-3.3.2/globals/Math/random.mdx | 21 -- .../version-3.3.2/globals/Math/round.mdx | 34 --- .../version-3.3.2/globals/Math/sign.mdx | 34 --- .../version-3.3.2/globals/Math/sin.mdx | 28 --- .../version-3.3.2/globals/Math/sinh.mdx | 29 --- .../version-3.3.2/globals/Math/sqrt.mdx | 29 --- .../version-3.3.2/globals/Math/tan.mdx | 31 --- .../version-3.3.2/globals/Math/tanh.mdx | 28 --- .../version-3.3.2/globals/Math/trunc.mdx | 30 --- .../version-3.3.2/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-3.3.2/globals/Number/NaN.mdx | 17 -- .../version-3.3.2/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-3.3.2/globals/Number/epsilon.mdx | 21 -- .../version-3.3.2/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-3.3.2/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-3.3.2/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-3.3.2/globals/Object/Object.mdx | 27 --- .../version-3.3.2/globals/Object/assign.mdx | 57 ----- .../version-3.3.2/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-3.3.2/globals/Object/entries.mdx | 30 --- .../version-3.3.2/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-3.3.2/globals/Object/hasOwn.mdx | 46 ---- .../version-3.3.2/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-3.3.2/globals/Object/isFrozen.mdx | 31 --- .../version-3.3.2/globals/Object/isSealed.mdx | 32 --- .../version-3.3.2/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-3.3.2/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-3.3.2/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-3.3.2/globals/Promise/Promise.mdx | 140 ----------- .../version-3.3.2/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-3.3.2/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-3.3.2/globals/Promise/race.mdx | 30 --- .../version-3.3.2/globals/Promise/reject.mdx | 32 --- .../version-3.3.2/globals/Promise/resolve.mdx | 39 --- .../version-3.3.2/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-3.3.2/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-3.3.2/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-3.3.2/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-3.3.2/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-3.3.2/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-3.3.2/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-3.3.2/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-3.3.2/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-3.3.2/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-3.3.2/globals/Request/Request.mdx | 46 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 18 -- .../version-3.3.2/globals/Set/@@species.mdx | 25 -- .../version-3.3.2/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-3.3.2/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-3.3.2/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 97 -------- .../globals/SubtleCrypto/prototype/sign.mdx | 60 ----- .../globals/SubtleCrypto/prototype/verify.mdx | 52 ---- .../version-3.3.2/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-3.3.2/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-3.3.2/globals/Symbol/iterator.mdx | 26 -- .../version-3.3.2/globals/Symbol/keyFor.mdx | 25 -- .../version-3.3.2/globals/Symbol/match.mdx | 19 -- .../version-3.3.2/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-3.3.2/globals/Symbol/replace.mdx | 15 -- .../version-3.3.2/globals/Symbol/search.mdx | 15 -- .../version-3.3.2/globals/Symbol/species.mdx | 21 -- .../version-3.3.2/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-3.3.2/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-3.3.2/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-3.3.2/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-3.3.2/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-3.3.2/globals/atob.mdx | 37 --- .../version-3.3.2/globals/btoa.mdx | 38 --- .../version-3.3.2/globals/clearInterval.mdx | 35 --- .../version-3.3.2/globals/clearTimeout.mdx | 36 --- .../version-3.3.2/globals/console/assert.mdx | 42 ---- .../version-3.3.2/globals/console/clear.mdx | 24 -- .../version-3.3.2/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-3.3.2/globals/console/debug.mdx | 26 -- .../version-3.3.2/globals/console/dir.mdx | 26 -- .../version-3.3.2/globals/console/dirxml.mdx | 25 -- .../version-3.3.2/globals/console/error.mdx | 26 -- .../version-3.3.2/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-3.3.2/globals/console/info.mdx | 26 -- .../version-3.3.2/globals/console/log.mdx | 30 --- .../version-3.3.2/globals/console/time.mdx | 29 --- .../version-3.3.2/globals/console/timeEnd.mdx | 26 -- .../version-3.3.2/globals/console/timeLog.mdx | 26 -- .../version-3.3.2/globals/console/trace.mdx | 27 --- .../version-3.3.2/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-3.3.2/globals/crypto/subtle.mdx | 16 -- .../version-3.3.2/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-3.3.2/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-3.3.2/globals/escape.mdx | 34 --- .../version-3.3.2/globals/eval.mdx | 36 --- .../version-3.3.2/globals/fetch.mdx | 65 ----- .../version-3.3.2/globals/globalThis.mdx | 20 -- .../version-3.3.2/globals/isFinite.mdx | 37 --- .../version-3.3.2/globals/isNaN.mdx | 36 --- .../version-3.3.2/globals/location.mdx | 18 -- .../version-3.3.2/globals/parseFloat.mdx | 41 ---- .../version-3.3.2/globals/parseInt.mdx | 68 ------ .../version-3.3.2/globals/performance/now.mdx | 25 -- .../globals/performance/timeOrigin.mdx | 16 -- .../version-3.3.2/globals/setInterval.mdx | 61 ----- .../version-3.3.2/globals/setTimeout.mdx | 61 ----- .../version-3.3.2/globals/structuredClone.mdx | 33 --- .../version-3.3.2/globals/undefined.mdx | 25 -- .../version-3.3.2/globals/unescape.mdx | 34 --- .../versioned_docs/version-3.3.2/index.mdx | 98 -------- .../version-3.3.2/migration-guide/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 227 ------------------ .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 47 ---- .../fastly:cache/SimpleCache/getOrSet.mdx | 81 ------- .../fastly:cache/SimpleCache/purge.mdx | 81 ------- .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-3.4.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-3.4.0/globals/Array/@@species.mdx | 57 ----- .../version-3.4.0/globals/Array/Array.mdx | 41 ---- .../version-3.4.0/globals/Array/from.mdx | 62 ----- .../version-3.4.0/globals/Array/isArray.mdx | 32 --- .../version-3.4.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-3.4.0/globals/BigInt/BigInt.mdx | 37 --- .../version-3.4.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-3.4.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-3.4.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DOMException/DOMException.mdx | 107 --------- .../globals/DOMException/code.mdx | 16 -- .../globals/DOMException/message.mdx | 14 -- .../globals/DOMException/name.mdx | 14 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-3.4.0/globals/Date/Date.mdx | 88 ------- .../version-3.4.0/globals/Date/UTC.mdx | 84 ------- .../version-3.4.0/globals/Date/now.mdx | 19 -- .../version-3.4.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../EcKeyImportParams/EcKeyImportParams.mdx | 22 -- .../version-3.4.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 38 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-3.4.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../HmacImportParams/HmacImportParams.mdx | 21 -- .../version-3.4.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-3.4.0/globals/JSON/parse.mdx | 50 ---- .../version-3.4.0/globals/JSON/stringify.mdx | 96 -------- .../version-3.4.0/globals/Map/@@species.mdx | 25 -- .../version-3.4.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-3.4.0/globals/Math/E.mdx | 17 -- .../version-3.4.0/globals/Math/LN10.mdx | 17 -- .../version-3.4.0/globals/Math/LN2.mdx | 17 -- .../version-3.4.0/globals/Math/LOG10e.mdx | 17 -- .../version-3.4.0/globals/Math/LOG2e.mdx | 17 -- .../version-3.4.0/globals/Math/PI.mdx | 17 -- .../version-3.4.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-3.4.0/globals/Math/SQRT2.mdx | 19 -- .../version-3.4.0/globals/Math/abs.mdx | 29 --- .../version-3.4.0/globals/Math/acos.mdx | 28 --- .../version-3.4.0/globals/Math/acosh.mdx | 28 --- .../version-3.4.0/globals/Math/asin.mdx | 28 --- .../version-3.4.0/globals/Math/asinh.mdx | 28 --- .../version-3.4.0/globals/Math/atan.mdx | 28 --- .../version-3.4.0/globals/Math/atan2.mdx | 51 ---- .../version-3.4.0/globals/Math/atanh.mdx | 29 --- .../version-3.4.0/globals/Math/cbrt.mdx | 28 --- .../version-3.4.0/globals/Math/ceil.mdx | 28 --- .../version-3.4.0/globals/Math/clz32.mdx | 34 --- .../version-3.4.0/globals/Math/cos.mdx | 28 --- .../version-3.4.0/globals/Math/cosh.mdx | 28 --- .../version-3.4.0/globals/Math/exp.mdx | 30 --- .../version-3.4.0/globals/Math/expm1.mdx | 32 --- .../version-3.4.0/globals/Math/floor.mdx | 28 --- .../version-3.4.0/globals/Math/fround.mdx | 32 --- .../version-3.4.0/globals/Math/hypot.mdx | 39 --- .../version-3.4.0/globals/Math/imul.mdx | 35 --- .../version-3.4.0/globals/Math/log.mdx | 32 --- .../version-3.4.0/globals/Math/log10.mdx | 30 --- .../version-3.4.0/globals/Math/log1p.mdx | 34 --- .../version-3.4.0/globals/Math/log2.mdx | 30 --- .../version-3.4.0/globals/Math/max.mdx | 33 --- .../version-3.4.0/globals/Math/min.mdx | 33 --- .../version-3.4.0/globals/Math/pow.mdx | 39 --- .../version-3.4.0/globals/Math/random.mdx | 21 -- .../version-3.4.0/globals/Math/round.mdx | 34 --- .../version-3.4.0/globals/Math/sign.mdx | 34 --- .../version-3.4.0/globals/Math/sin.mdx | 28 --- .../version-3.4.0/globals/Math/sinh.mdx | 29 --- .../version-3.4.0/globals/Math/sqrt.mdx | 29 --- .../version-3.4.0/globals/Math/tan.mdx | 31 --- .../version-3.4.0/globals/Math/tanh.mdx | 28 --- .../version-3.4.0/globals/Math/trunc.mdx | 30 --- .../version-3.4.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-3.4.0/globals/Number/NaN.mdx | 17 -- .../version-3.4.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-3.4.0/globals/Number/epsilon.mdx | 21 -- .../version-3.4.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-3.4.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-3.4.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-3.4.0/globals/Object/Object.mdx | 27 --- .../version-3.4.0/globals/Object/assign.mdx | 57 ----- .../version-3.4.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-3.4.0/globals/Object/entries.mdx | 30 --- .../version-3.4.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-3.4.0/globals/Object/hasOwn.mdx | 46 ---- .../version-3.4.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-3.4.0/globals/Object/isFrozen.mdx | 31 --- .../version-3.4.0/globals/Object/isSealed.mdx | 32 --- .../version-3.4.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-3.4.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-3.4.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-3.4.0/globals/Promise/Promise.mdx | 140 ----------- .../version-3.4.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-3.4.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-3.4.0/globals/Promise/race.mdx | 30 --- .../version-3.4.0/globals/Promise/reject.mdx | 32 --- .../version-3.4.0/globals/Promise/resolve.mdx | 39 --- .../version-3.4.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-3.4.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-3.4.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-3.4.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-3.4.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-3.4.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-3.4.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-3.4.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-3.4.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-3.4.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-3.4.0/globals/Request/Request.mdx | 46 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/clone.mdx | 34 --- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 18 -- .../version-3.4.0/globals/Set/@@species.mdx | 25 -- .../version-3.4.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-3.4.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-3.4.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../globals/SubtleCrypto/prototype/sign.mdx | 60 ----- .../globals/SubtleCrypto/prototype/verify.mdx | 52 ---- .../version-3.4.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-3.4.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-3.4.0/globals/Symbol/iterator.mdx | 26 -- .../version-3.4.0/globals/Symbol/keyFor.mdx | 25 -- .../version-3.4.0/globals/Symbol/match.mdx | 19 -- .../version-3.4.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-3.4.0/globals/Symbol/replace.mdx | 15 -- .../version-3.4.0/globals/Symbol/search.mdx | 15 -- .../version-3.4.0/globals/Symbol/species.mdx | 21 -- .../version-3.4.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-3.4.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-3.4.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-3.4.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-3.4.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-3.4.0/globals/atob.mdx | 37 --- .../version-3.4.0/globals/btoa.mdx | 38 --- .../version-3.4.0/globals/clearInterval.mdx | 35 --- .../version-3.4.0/globals/clearTimeout.mdx | 36 --- .../version-3.4.0/globals/console/assert.mdx | 42 ---- .../version-3.4.0/globals/console/clear.mdx | 24 -- .../version-3.4.0/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-3.4.0/globals/console/debug.mdx | 26 -- .../version-3.4.0/globals/console/dir.mdx | 26 -- .../version-3.4.0/globals/console/dirxml.mdx | 25 -- .../version-3.4.0/globals/console/error.mdx | 26 -- .../version-3.4.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-3.4.0/globals/console/info.mdx | 26 -- .../version-3.4.0/globals/console/log.mdx | 30 --- .../version-3.4.0/globals/console/time.mdx | 29 --- .../version-3.4.0/globals/console/timeEnd.mdx | 26 -- .../version-3.4.0/globals/console/timeLog.mdx | 26 -- .../version-3.4.0/globals/console/trace.mdx | 27 --- .../version-3.4.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-3.4.0/globals/crypto/subtle.mdx | 16 -- .../version-3.4.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-3.4.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-3.4.0/globals/escape.mdx | 34 --- .../version-3.4.0/globals/eval.mdx | 36 --- .../version-3.4.0/globals/fetch.mdx | 65 ----- .../version-3.4.0/globals/globalThis.mdx | 20 -- .../version-3.4.0/globals/isFinite.mdx | 37 --- .../version-3.4.0/globals/isNaN.mdx | 36 --- .../version-3.4.0/globals/location.mdx | 18 -- .../version-3.4.0/globals/parseFloat.mdx | 41 ---- .../version-3.4.0/globals/parseInt.mdx | 68 ------ .../version-3.4.0/globals/performance/now.mdx | 25 -- .../globals/performance/timeOrigin.mdx | 16 -- .../version-3.4.0/globals/setInterval.mdx | 61 ----- .../version-3.4.0/globals/setTimeout.mdx | 61 ----- .../version-3.4.0/globals/structuredClone.mdx | 33 --- .../version-3.4.0/globals/undefined.mdx | 25 -- .../version-3.4.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-3.4.0/index.mdx | 98 -------- .../version-3.4.0/migration-guide/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 227 ------------------ .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 47 ---- .../fastly:cache/SimpleCache/get.mdx | 58 ----- .../fastly:cache/SimpleCache/getOrSet.mdx | 81 ------- .../fastly:cache/SimpleCache/purge.mdx | 81 ------- .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-3.5.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-3.5.0/globals/Array/@@species.mdx | 57 ----- .../version-3.5.0/globals/Array/Array.mdx | 41 ---- .../version-3.5.0/globals/Array/from.mdx | 62 ----- .../version-3.5.0/globals/Array/isArray.mdx | 32 --- .../version-3.5.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-3.5.0/globals/BigInt/BigInt.mdx | 37 --- .../version-3.5.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-3.5.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-3.5.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DOMException/DOMException.mdx | 107 --------- .../globals/DOMException/code.mdx | 16 -- .../globals/DOMException/message.mdx | 14 -- .../globals/DOMException/name.mdx | 14 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-3.5.0/globals/Date/Date.mdx | 88 ------- .../version-3.5.0/globals/Date/UTC.mdx | 84 ------- .../version-3.5.0/globals/Date/now.mdx | 19 -- .../version-3.5.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../EcKeyImportParams/EcKeyImportParams.mdx | 22 -- .../globals/EcdsaParams/EcdsaParams.mdx | 24 -- .../version-3.5.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 38 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-3.5.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../HmacImportParams/HmacImportParams.mdx | 21 -- .../version-3.5.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-3.5.0/globals/JSON/parse.mdx | 50 ---- .../version-3.5.0/globals/JSON/stringify.mdx | 96 -------- .../version-3.5.0/globals/Map/@@species.mdx | 25 -- .../version-3.5.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-3.5.0/globals/Math/E.mdx | 17 -- .../version-3.5.0/globals/Math/LN10.mdx | 17 -- .../version-3.5.0/globals/Math/LN2.mdx | 17 -- .../version-3.5.0/globals/Math/LOG10e.mdx | 17 -- .../version-3.5.0/globals/Math/LOG2e.mdx | 17 -- .../version-3.5.0/globals/Math/PI.mdx | 17 -- .../version-3.5.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-3.5.0/globals/Math/SQRT2.mdx | 19 -- .../version-3.5.0/globals/Math/abs.mdx | 29 --- .../version-3.5.0/globals/Math/acos.mdx | 28 --- .../version-3.5.0/globals/Math/acosh.mdx | 28 --- .../version-3.5.0/globals/Math/asin.mdx | 28 --- .../version-3.5.0/globals/Math/asinh.mdx | 28 --- .../version-3.5.0/globals/Math/atan.mdx | 28 --- .../version-3.5.0/globals/Math/atan2.mdx | 51 ---- .../version-3.5.0/globals/Math/atanh.mdx | 29 --- .../version-3.5.0/globals/Math/cbrt.mdx | 28 --- .../version-3.5.0/globals/Math/ceil.mdx | 28 --- .../version-3.5.0/globals/Math/clz32.mdx | 34 --- .../version-3.5.0/globals/Math/cos.mdx | 28 --- .../version-3.5.0/globals/Math/cosh.mdx | 28 --- .../version-3.5.0/globals/Math/exp.mdx | 30 --- .../version-3.5.0/globals/Math/expm1.mdx | 32 --- .../version-3.5.0/globals/Math/floor.mdx | 28 --- .../version-3.5.0/globals/Math/fround.mdx | 32 --- .../version-3.5.0/globals/Math/hypot.mdx | 39 --- .../version-3.5.0/globals/Math/imul.mdx | 35 --- .../version-3.5.0/globals/Math/log.mdx | 32 --- .../version-3.5.0/globals/Math/log10.mdx | 30 --- .../version-3.5.0/globals/Math/log1p.mdx | 34 --- .../version-3.5.0/globals/Math/log2.mdx | 30 --- .../version-3.5.0/globals/Math/max.mdx | 33 --- .../version-3.5.0/globals/Math/min.mdx | 33 --- .../version-3.5.0/globals/Math/pow.mdx | 39 --- .../version-3.5.0/globals/Math/random.mdx | 21 -- .../version-3.5.0/globals/Math/round.mdx | 34 --- .../version-3.5.0/globals/Math/sign.mdx | 34 --- .../version-3.5.0/globals/Math/sin.mdx | 28 --- .../version-3.5.0/globals/Math/sinh.mdx | 29 --- .../version-3.5.0/globals/Math/sqrt.mdx | 29 --- .../version-3.5.0/globals/Math/tan.mdx | 31 --- .../version-3.5.0/globals/Math/tanh.mdx | 28 --- .../version-3.5.0/globals/Math/trunc.mdx | 30 --- .../version-3.5.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-3.5.0/globals/Number/NaN.mdx | 17 -- .../version-3.5.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-3.5.0/globals/Number/epsilon.mdx | 21 -- .../version-3.5.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-3.5.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-3.5.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-3.5.0/globals/Object/Object.mdx | 27 --- .../version-3.5.0/globals/Object/assign.mdx | 57 ----- .../version-3.5.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-3.5.0/globals/Object/entries.mdx | 30 --- .../version-3.5.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-3.5.0/globals/Object/hasOwn.mdx | 46 ---- .../version-3.5.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-3.5.0/globals/Object/isFrozen.mdx | 31 --- .../version-3.5.0/globals/Object/isSealed.mdx | 32 --- .../version-3.5.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-3.5.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-3.5.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-3.5.0/globals/Promise/Promise.mdx | 140 ----------- .../version-3.5.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-3.5.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-3.5.0/globals/Promise/race.mdx | 30 --- .../version-3.5.0/globals/Promise/reject.mdx | 32 --- .../version-3.5.0/globals/Promise/resolve.mdx | 39 --- .../version-3.5.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-3.5.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-3.5.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-3.5.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-3.5.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-3.5.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-3.5.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-3.5.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-3.5.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-3.5.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-3.5.0/globals/Request/Request.mdx | 46 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/clone.mdx | 34 --- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 18 -- .../version-3.5.0/globals/Set/@@species.mdx | 25 -- .../version-3.5.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-3.5.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-3.5.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 99 -------- .../globals/SubtleCrypto/prototype/sign.mdx | 60 ----- .../globals/SubtleCrypto/prototype/verify.mdx | 52 ---- .../version-3.5.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-3.5.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-3.5.0/globals/Symbol/iterator.mdx | 26 -- .../version-3.5.0/globals/Symbol/keyFor.mdx | 25 -- .../version-3.5.0/globals/Symbol/match.mdx | 19 -- .../version-3.5.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-3.5.0/globals/Symbol/replace.mdx | 15 -- .../version-3.5.0/globals/Symbol/search.mdx | 15 -- .../version-3.5.0/globals/Symbol/species.mdx | 21 -- .../version-3.5.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-3.5.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-3.5.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-3.5.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-3.5.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-3.5.0/globals/atob.mdx | 37 --- .../version-3.5.0/globals/btoa.mdx | 38 --- .../version-3.5.0/globals/clearInterval.mdx | 35 --- .../version-3.5.0/globals/clearTimeout.mdx | 36 --- .../version-3.5.0/globals/console/assert.mdx | 42 ---- .../version-3.5.0/globals/console/clear.mdx | 24 -- .../version-3.5.0/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-3.5.0/globals/console/debug.mdx | 26 -- .../version-3.5.0/globals/console/dir.mdx | 26 -- .../version-3.5.0/globals/console/dirxml.mdx | 25 -- .../version-3.5.0/globals/console/error.mdx | 26 -- .../version-3.5.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-3.5.0/globals/console/info.mdx | 26 -- .../version-3.5.0/globals/console/log.mdx | 30 --- .../version-3.5.0/globals/console/time.mdx | 29 --- .../version-3.5.0/globals/console/timeEnd.mdx | 26 -- .../version-3.5.0/globals/console/timeLog.mdx | 26 -- .../version-3.5.0/globals/console/trace.mdx | 27 --- .../version-3.5.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-3.5.0/globals/crypto/subtle.mdx | 16 -- .../version-3.5.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-3.5.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-3.5.0/globals/escape.mdx | 34 --- .../version-3.5.0/globals/eval.mdx | 36 --- .../version-3.5.0/globals/fetch.mdx | 65 ----- .../version-3.5.0/globals/globalThis.mdx | 20 -- .../version-3.5.0/globals/isFinite.mdx | 37 --- .../version-3.5.0/globals/isNaN.mdx | 36 --- .../version-3.5.0/globals/location.mdx | 18 -- .../version-3.5.0/globals/parseFloat.mdx | 41 ---- .../version-3.5.0/globals/parseInt.mdx | 68 ------ .../version-3.5.0/globals/performance/now.mdx | 25 -- .../globals/performance/timeOrigin.mdx | 16 -- .../version-3.5.0/globals/setInterval.mdx | 61 ----- .../version-3.5.0/globals/setTimeout.mdx | 61 ----- .../version-3.5.0/globals/structuredClone.mdx | 33 --- .../version-3.5.0/globals/undefined.mdx | 25 -- .../version-3.5.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-3.5.0/index.mdx | 98 -------- .../version-3.5.0/migration-guide/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 227 ------------------ .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 47 ---- .../fastly:cache/SimpleCache/get.mdx | 58 ----- .../fastly:cache/SimpleCache/getOrSet.mdx | 81 ------- .../fastly:cache/SimpleCache/purge.mdx | 81 ------- .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-3.6.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-3.6.0/globals/Array/@@species.mdx | 57 ----- .../version-3.6.0/globals/Array/Array.mdx | 41 ---- .../version-3.6.0/globals/Array/from.mdx | 62 ----- .../version-3.6.0/globals/Array/isArray.mdx | 32 --- .../version-3.6.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-3.6.0/globals/BigInt/BigInt.mdx | 37 --- .../version-3.6.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-3.6.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-3.6.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DOMException/DOMException.mdx | 107 --------- .../globals/DOMException/code.mdx | 16 -- .../globals/DOMException/message.mdx | 14 -- .../globals/DOMException/name.mdx | 14 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-3.6.0/globals/Date/Date.mdx | 88 ------- .../version-3.6.0/globals/Date/UTC.mdx | 84 ------- .../version-3.6.0/globals/Date/now.mdx | 19 -- .../version-3.6.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../EcKeyImportParams/EcKeyImportParams.mdx | 22 -- .../globals/EcdsaParams/EcdsaParams.mdx | 24 -- .../version-3.6.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 38 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-3.6.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../HmacImportParams/HmacImportParams.mdx | 21 -- .../version-3.6.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-3.6.0/globals/JSON/parse.mdx | 50 ---- .../version-3.6.0/globals/JSON/stringify.mdx | 96 -------- .../version-3.6.0/globals/Map/@@species.mdx | 25 -- .../version-3.6.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-3.6.0/globals/Math/E.mdx | 17 -- .../version-3.6.0/globals/Math/LN10.mdx | 17 -- .../version-3.6.0/globals/Math/LN2.mdx | 17 -- .../version-3.6.0/globals/Math/LOG10e.mdx | 17 -- .../version-3.6.0/globals/Math/LOG2e.mdx | 17 -- .../version-3.6.0/globals/Math/PI.mdx | 17 -- .../version-3.6.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-3.6.0/globals/Math/SQRT2.mdx | 19 -- .../version-3.6.0/globals/Math/abs.mdx | 29 --- .../version-3.6.0/globals/Math/acos.mdx | 28 --- .../version-3.6.0/globals/Math/acosh.mdx | 28 --- .../version-3.6.0/globals/Math/asin.mdx | 28 --- .../version-3.6.0/globals/Math/asinh.mdx | 28 --- .../version-3.6.0/globals/Math/atan.mdx | 28 --- .../version-3.6.0/globals/Math/atan2.mdx | 51 ---- .../version-3.6.0/globals/Math/atanh.mdx | 29 --- .../version-3.6.0/globals/Math/cbrt.mdx | 28 --- .../version-3.6.0/globals/Math/ceil.mdx | 28 --- .../version-3.6.0/globals/Math/clz32.mdx | 34 --- .../version-3.6.0/globals/Math/cos.mdx | 28 --- .../version-3.6.0/globals/Math/cosh.mdx | 28 --- .../version-3.6.0/globals/Math/exp.mdx | 30 --- .../version-3.6.0/globals/Math/expm1.mdx | 32 --- .../version-3.6.0/globals/Math/floor.mdx | 28 --- .../version-3.6.0/globals/Math/fround.mdx | 32 --- .../version-3.6.0/globals/Math/hypot.mdx | 39 --- .../version-3.6.0/globals/Math/imul.mdx | 35 --- .../version-3.6.0/globals/Math/log.mdx | 32 --- .../version-3.6.0/globals/Math/log10.mdx | 30 --- .../version-3.6.0/globals/Math/log1p.mdx | 34 --- .../version-3.6.0/globals/Math/log2.mdx | 30 --- .../version-3.6.0/globals/Math/max.mdx | 33 --- .../version-3.6.0/globals/Math/min.mdx | 33 --- .../version-3.6.0/globals/Math/pow.mdx | 39 --- .../version-3.6.0/globals/Math/random.mdx | 21 -- .../version-3.6.0/globals/Math/round.mdx | 34 --- .../version-3.6.0/globals/Math/sign.mdx | 34 --- .../version-3.6.0/globals/Math/sin.mdx | 28 --- .../version-3.6.0/globals/Math/sinh.mdx | 29 --- .../version-3.6.0/globals/Math/sqrt.mdx | 29 --- .../version-3.6.0/globals/Math/tan.mdx | 31 --- .../version-3.6.0/globals/Math/tanh.mdx | 28 --- .../version-3.6.0/globals/Math/trunc.mdx | 30 --- .../version-3.6.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-3.6.0/globals/Number/NaN.mdx | 17 -- .../version-3.6.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-3.6.0/globals/Number/epsilon.mdx | 21 -- .../version-3.6.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-3.6.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-3.6.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-3.6.0/globals/Object/Object.mdx | 27 --- .../version-3.6.0/globals/Object/assign.mdx | 57 ----- .../version-3.6.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-3.6.0/globals/Object/entries.mdx | 30 --- .../version-3.6.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-3.6.0/globals/Object/hasOwn.mdx | 46 ---- .../version-3.6.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-3.6.0/globals/Object/isFrozen.mdx | 31 --- .../version-3.6.0/globals/Object/isSealed.mdx | 32 --- .../version-3.6.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-3.6.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-3.6.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-3.6.0/globals/Promise/Promise.mdx | 140 ----------- .../version-3.6.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-3.6.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-3.6.0/globals/Promise/race.mdx | 30 --- .../version-3.6.0/globals/Promise/reject.mdx | 32 --- .../version-3.6.0/globals/Promise/resolve.mdx | 39 --- .../version-3.6.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-3.6.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-3.6.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-3.6.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-3.6.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-3.6.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-3.6.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-3.6.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-3.6.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-3.6.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-3.6.0/globals/Request/Request.mdx | 46 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/clone.mdx | 34 --- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 18 -- .../version-3.6.0/globals/Set/@@species.mdx | 25 -- .../version-3.6.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-3.6.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-3.6.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 99 -------- .../globals/SubtleCrypto/prototype/sign.mdx | 60 ----- .../globals/SubtleCrypto/prototype/verify.mdx | 52 ---- .../version-3.6.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-3.6.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-3.6.0/globals/Symbol/iterator.mdx | 26 -- .../version-3.6.0/globals/Symbol/keyFor.mdx | 25 -- .../version-3.6.0/globals/Symbol/match.mdx | 19 -- .../version-3.6.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-3.6.0/globals/Symbol/replace.mdx | 15 -- .../version-3.6.0/globals/Symbol/search.mdx | 15 -- .../version-3.6.0/globals/Symbol/species.mdx | 21 -- .../version-3.6.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-3.6.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-3.6.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-3.6.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-3.6.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-3.6.0/globals/atob.mdx | 37 --- .../version-3.6.0/globals/btoa.mdx | 38 --- .../version-3.6.0/globals/clearInterval.mdx | 35 --- .../version-3.6.0/globals/clearTimeout.mdx | 36 --- .../version-3.6.0/globals/console/assert.mdx | 42 ---- .../version-3.6.0/globals/console/clear.mdx | 24 -- .../version-3.6.0/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-3.6.0/globals/console/debug.mdx | 26 -- .../version-3.6.0/globals/console/dir.mdx | 26 -- .../version-3.6.0/globals/console/dirxml.mdx | 25 -- .../version-3.6.0/globals/console/error.mdx | 26 -- .../version-3.6.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-3.6.0/globals/console/info.mdx | 26 -- .../version-3.6.0/globals/console/log.mdx | 30 --- .../version-3.6.0/globals/console/time.mdx | 29 --- .../version-3.6.0/globals/console/timeEnd.mdx | 26 -- .../version-3.6.0/globals/console/timeLog.mdx | 26 -- .../version-3.6.0/globals/console/trace.mdx | 27 --- .../version-3.6.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-3.6.0/globals/crypto/subtle.mdx | 16 -- .../version-3.6.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-3.6.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-3.6.0/globals/escape.mdx | 34 --- .../version-3.6.0/globals/eval.mdx | 36 --- .../version-3.6.0/globals/fetch.mdx | 65 ----- .../version-3.6.0/globals/globalThis.mdx | 20 -- .../version-3.6.0/globals/isFinite.mdx | 37 --- .../version-3.6.0/globals/isNaN.mdx | 36 --- .../version-3.6.0/globals/location.mdx | 18 -- .../version-3.6.0/globals/parseFloat.mdx | 41 ---- .../version-3.6.0/globals/parseInt.mdx | 68 ------ .../version-3.6.0/globals/performance/now.mdx | 25 -- .../globals/performance/timeOrigin.mdx | 16 -- .../version-3.6.0/globals/setInterval.mdx | 61 ----- .../version-3.6.0/globals/setTimeout.mdx | 61 ----- .../version-3.6.0/globals/structuredClone.mdx | 33 --- .../version-3.6.0/globals/undefined.mdx | 25 -- .../version-3.6.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-3.6.0/index.mdx | 98 -------- .../version-3.6.0/migration-guide/index.mdx | 98 -------- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 47 ---- .../fastly:cache/SimpleCache/get.mdx | 58 ----- .../fastly:cache/SimpleCache/getOrSet.mdx | 81 ------- .../fastly:cache/SimpleCache/purge.mdx | 81 ------- .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-3.7.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-3.7.0/globals/Array/@@species.mdx | 57 ----- .../version-3.7.0/globals/Array/Array.mdx | 41 ---- .../version-3.7.0/globals/Array/from.mdx | 62 ----- .../version-3.7.0/globals/Array/isArray.mdx | 32 --- .../version-3.7.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-3.7.0/globals/BigInt/BigInt.mdx | 37 --- .../version-3.7.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-3.7.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-3.7.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DOMException/DOMException.mdx | 107 --------- .../globals/DOMException/code.mdx | 16 -- .../globals/DOMException/message.mdx | 14 -- .../globals/DOMException/name.mdx | 14 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-3.7.0/globals/Date/Date.mdx | 88 ------- .../version-3.7.0/globals/Date/UTC.mdx | 84 ------- .../version-3.7.0/globals/Date/now.mdx | 19 -- .../version-3.7.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../globals/EcdsaParams/EcdsaParams.mdx | 24 -- .../version-3.7.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 38 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-3.7.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../HmacImportParams/HmacImportParams.mdx | 21 -- .../version-3.7.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-3.7.0/globals/JSON/parse.mdx | 50 ---- .../version-3.7.0/globals/JSON/stringify.mdx | 96 -------- .../version-3.7.0/globals/Map/@@species.mdx | 25 -- .../version-3.7.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-3.7.0/globals/Math/E.mdx | 17 -- .../version-3.7.0/globals/Math/LN10.mdx | 17 -- .../version-3.7.0/globals/Math/LN2.mdx | 17 -- .../version-3.7.0/globals/Math/LOG10e.mdx | 17 -- .../version-3.7.0/globals/Math/LOG2e.mdx | 17 -- .../version-3.7.0/globals/Math/PI.mdx | 17 -- .../version-3.7.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-3.7.0/globals/Math/SQRT2.mdx | 19 -- .../version-3.7.0/globals/Math/abs.mdx | 29 --- .../version-3.7.0/globals/Math/acos.mdx | 28 --- .../version-3.7.0/globals/Math/acosh.mdx | 28 --- .../version-3.7.0/globals/Math/asin.mdx | 28 --- .../version-3.7.0/globals/Math/asinh.mdx | 28 --- .../version-3.7.0/globals/Math/atan.mdx | 28 --- .../version-3.7.0/globals/Math/atan2.mdx | 51 ---- .../version-3.7.0/globals/Math/atanh.mdx | 29 --- .../version-3.7.0/globals/Math/cbrt.mdx | 28 --- .../version-3.7.0/globals/Math/ceil.mdx | 28 --- .../version-3.7.0/globals/Math/clz32.mdx | 34 --- .../version-3.7.0/globals/Math/cos.mdx | 28 --- .../version-3.7.0/globals/Math/cosh.mdx | 28 --- .../version-3.7.0/globals/Math/exp.mdx | 30 --- .../version-3.7.0/globals/Math/expm1.mdx | 32 --- .../version-3.7.0/globals/Math/floor.mdx | 28 --- .../version-3.7.0/globals/Math/fround.mdx | 32 --- .../version-3.7.0/globals/Math/hypot.mdx | 39 --- .../version-3.7.0/globals/Math/imul.mdx | 35 --- .../version-3.7.0/globals/Math/log.mdx | 32 --- .../version-3.7.0/globals/Math/log10.mdx | 30 --- .../version-3.7.0/globals/Math/log1p.mdx | 34 --- .../version-3.7.0/globals/Math/log2.mdx | 30 --- .../version-3.7.0/globals/Math/max.mdx | 33 --- .../version-3.7.0/globals/Math/min.mdx | 33 --- .../version-3.7.0/globals/Math/pow.mdx | 39 --- .../version-3.7.0/globals/Math/random.mdx | 21 -- .../version-3.7.0/globals/Math/round.mdx | 34 --- .../version-3.7.0/globals/Math/sign.mdx | 34 --- .../version-3.7.0/globals/Math/sin.mdx | 28 --- .../version-3.7.0/globals/Math/sinh.mdx | 29 --- .../version-3.7.0/globals/Math/sqrt.mdx | 29 --- .../version-3.7.0/globals/Math/tan.mdx | 31 --- .../version-3.7.0/globals/Math/tanh.mdx | 28 --- .../version-3.7.0/globals/Math/trunc.mdx | 30 --- .../version-3.7.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-3.7.0/globals/Number/NaN.mdx | 17 -- .../version-3.7.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-3.7.0/globals/Number/epsilon.mdx | 21 -- .../version-3.7.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-3.7.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-3.7.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-3.7.0/globals/Object/Object.mdx | 27 --- .../version-3.7.0/globals/Object/assign.mdx | 57 ----- .../version-3.7.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-3.7.0/globals/Object/entries.mdx | 30 --- .../version-3.7.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-3.7.0/globals/Object/hasOwn.mdx | 46 ---- .../version-3.7.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-3.7.0/globals/Object/isFrozen.mdx | 31 --- .../version-3.7.0/globals/Object/isSealed.mdx | 32 --- .../version-3.7.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-3.7.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-3.7.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-3.7.0/globals/Promise/Promise.mdx | 140 ----------- .../version-3.7.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-3.7.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-3.7.0/globals/Promise/race.mdx | 30 --- .../version-3.7.0/globals/Promise/reject.mdx | 32 --- .../version-3.7.0/globals/Promise/resolve.mdx | 39 --- .../version-3.7.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-3.7.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-3.7.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-3.7.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-3.7.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-3.7.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-3.7.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-3.7.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-3.7.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-3.7.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-3.7.0/globals/Request/Request.mdx | 46 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/clone.mdx | 34 --- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 47 ---- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 18 -- .../version-3.7.0/globals/Set/@@species.mdx | 25 -- .../version-3.7.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-3.7.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-3.7.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 99 -------- .../globals/SubtleCrypto/prototype/sign.mdx | 60 ----- .../globals/SubtleCrypto/prototype/verify.mdx | 52 ---- .../version-3.7.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-3.7.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-3.7.0/globals/Symbol/iterator.mdx | 26 -- .../version-3.7.0/globals/Symbol/keyFor.mdx | 25 -- .../version-3.7.0/globals/Symbol/match.mdx | 19 -- .../version-3.7.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-3.7.0/globals/Symbol/replace.mdx | 15 -- .../version-3.7.0/globals/Symbol/search.mdx | 15 -- .../version-3.7.0/globals/Symbol/species.mdx | 21 -- .../version-3.7.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-3.7.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-3.7.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-3.7.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-3.7.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-3.7.0/globals/atob.mdx | 37 --- .../version-3.7.0/globals/btoa.mdx | 38 --- .../version-3.7.0/globals/clearInterval.mdx | 35 --- .../version-3.7.0/globals/clearTimeout.mdx | 36 --- .../version-3.7.0/globals/console/assert.mdx | 42 ---- .../version-3.7.0/globals/console/clear.mdx | 24 -- .../version-3.7.0/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-3.7.0/globals/console/debug.mdx | 26 -- .../version-3.7.0/globals/console/dir.mdx | 26 -- .../version-3.7.0/globals/console/dirxml.mdx | 25 -- .../version-3.7.0/globals/console/error.mdx | 26 -- .../version-3.7.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-3.7.0/globals/console/info.mdx | 26 -- .../version-3.7.0/globals/console/log.mdx | 30 --- .../version-3.7.0/globals/console/time.mdx | 29 --- .../version-3.7.0/globals/console/timeEnd.mdx | 26 -- .../version-3.7.0/globals/console/timeLog.mdx | 26 -- .../version-3.7.0/globals/console/trace.mdx | 27 --- .../version-3.7.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-3.7.0/globals/crypto/subtle.mdx | 16 -- .../version-3.7.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-3.7.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-3.7.0/globals/escape.mdx | 34 --- .../version-3.7.0/globals/eval.mdx | 36 --- .../version-3.7.0/globals/fetch.mdx | 65 ----- .../version-3.7.0/globals/globalThis.mdx | 20 -- .../version-3.7.0/globals/isFinite.mdx | 37 --- .../version-3.7.0/globals/isNaN.mdx | 36 --- .../version-3.7.0/globals/location.mdx | 18 -- .../version-3.7.0/globals/parseFloat.mdx | 41 ---- .../version-3.7.0/globals/parseInt.mdx | 68 ------ .../version-3.7.0/globals/performance/now.mdx | 25 -- .../globals/performance/timeOrigin.mdx | 16 -- .../version-3.7.0/globals/setInterval.mdx | 61 ----- .../version-3.7.0/globals/setTimeout.mdx | 61 ----- .../version-3.7.0/globals/structuredClone.mdx | 33 --- .../version-3.7.0/globals/undefined.mdx | 25 -- .../version-3.7.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-3.7.0/index.mdx | 98 -------- .../version-3.7.0/migration-guide/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 227 ------------------ .../fastly:backend/Backend/exists.mdx | 20 -- .../fastly:backend/Backend/fromName.mdx | 20 -- .../fastly:backend/Backend/health.mdx | 25 -- .../Backend/prototype/toName.mdx | 20 -- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 47 ---- .../fastly:cache/SimpleCache/get.mdx | 58 ----- .../fastly:cache/SimpleCache/purge.mdx | 81 ------- .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-3.8.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-3.8.0/globals/Array/@@species.mdx | 57 ----- .../version-3.8.0/globals/Array/Array.mdx | 41 ---- .../version-3.8.0/globals/Array/from.mdx | 62 ----- .../version-3.8.0/globals/Array/isArray.mdx | 32 --- .../version-3.8.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-3.8.0/globals/BigInt/BigInt.mdx | 37 --- .../version-3.8.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-3.8.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-3.8.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DOMException/DOMException.mdx | 107 --------- .../globals/DOMException/code.mdx | 16 -- .../globals/DOMException/message.mdx | 14 -- .../globals/DOMException/name.mdx | 14 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-3.8.0/globals/Date/Date.mdx | 88 ------- .../version-3.8.0/globals/Date/UTC.mdx | 84 ------- .../version-3.8.0/globals/Date/now.mdx | 19 -- .../version-3.8.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../EcKeyImportParams/EcKeyImportParams.mdx | 21 -- .../globals/EcdsaParams/EcdsaParams.mdx | 24 -- .../version-3.8.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 38 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-3.8.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../HmacImportParams/HmacImportParams.mdx | 21 -- .../version-3.8.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-3.8.0/globals/JSON/parse.mdx | 50 ---- .../version-3.8.0/globals/JSON/stringify.mdx | 96 -------- .../version-3.8.0/globals/Map/@@species.mdx | 25 -- .../version-3.8.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-3.8.0/globals/Math/E.mdx | 17 -- .../version-3.8.0/globals/Math/LN10.mdx | 17 -- .../version-3.8.0/globals/Math/LN2.mdx | 17 -- .../version-3.8.0/globals/Math/LOG10e.mdx | 17 -- .../version-3.8.0/globals/Math/LOG2e.mdx | 17 -- .../version-3.8.0/globals/Math/PI.mdx | 17 -- .../version-3.8.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-3.8.0/globals/Math/SQRT2.mdx | 19 -- .../version-3.8.0/globals/Math/abs.mdx | 29 --- .../version-3.8.0/globals/Math/acos.mdx | 28 --- .../version-3.8.0/globals/Math/acosh.mdx | 28 --- .../version-3.8.0/globals/Math/asin.mdx | 28 --- .../version-3.8.0/globals/Math/asinh.mdx | 28 --- .../version-3.8.0/globals/Math/atan.mdx | 28 --- .../version-3.8.0/globals/Math/atan2.mdx | 51 ---- .../version-3.8.0/globals/Math/atanh.mdx | 29 --- .../version-3.8.0/globals/Math/cbrt.mdx | 28 --- .../version-3.8.0/globals/Math/ceil.mdx | 28 --- .../version-3.8.0/globals/Math/clz32.mdx | 34 --- .../version-3.8.0/globals/Math/cos.mdx | 28 --- .../version-3.8.0/globals/Math/cosh.mdx | 28 --- .../version-3.8.0/globals/Math/exp.mdx | 30 --- .../version-3.8.0/globals/Math/expm1.mdx | 32 --- .../version-3.8.0/globals/Math/floor.mdx | 28 --- .../version-3.8.0/globals/Math/fround.mdx | 32 --- .../version-3.8.0/globals/Math/hypot.mdx | 39 --- .../version-3.8.0/globals/Math/imul.mdx | 35 --- .../version-3.8.0/globals/Math/log.mdx | 32 --- .../version-3.8.0/globals/Math/log10.mdx | 30 --- .../version-3.8.0/globals/Math/log1p.mdx | 34 --- .../version-3.8.0/globals/Math/log2.mdx | 30 --- .../version-3.8.0/globals/Math/max.mdx | 33 --- .../version-3.8.0/globals/Math/min.mdx | 33 --- .../version-3.8.0/globals/Math/pow.mdx | 39 --- .../version-3.8.0/globals/Math/random.mdx | 21 -- .../version-3.8.0/globals/Math/round.mdx | 34 --- .../version-3.8.0/globals/Math/sign.mdx | 34 --- .../version-3.8.0/globals/Math/sin.mdx | 28 --- .../version-3.8.0/globals/Math/sinh.mdx | 29 --- .../version-3.8.0/globals/Math/sqrt.mdx | 29 --- .../version-3.8.0/globals/Math/tan.mdx | 31 --- .../version-3.8.0/globals/Math/tanh.mdx | 28 --- .../version-3.8.0/globals/Math/trunc.mdx | 30 --- .../version-3.8.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-3.8.0/globals/Number/NaN.mdx | 17 -- .../version-3.8.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-3.8.0/globals/Number/epsilon.mdx | 21 -- .../version-3.8.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-3.8.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-3.8.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-3.8.0/globals/Object/Object.mdx | 27 --- .../version-3.8.0/globals/Object/assign.mdx | 57 ----- .../version-3.8.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-3.8.0/globals/Object/entries.mdx | 30 --- .../version-3.8.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-3.8.0/globals/Object/hasOwn.mdx | 46 ---- .../version-3.8.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-3.8.0/globals/Object/isFrozen.mdx | 31 --- .../version-3.8.0/globals/Object/isSealed.mdx | 32 --- .../version-3.8.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-3.8.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-3.8.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-3.8.0/globals/Promise/Promise.mdx | 140 ----------- .../version-3.8.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-3.8.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-3.8.0/globals/Promise/race.mdx | 30 --- .../version-3.8.0/globals/Promise/reject.mdx | 32 --- .../version-3.8.0/globals/Promise/resolve.mdx | 39 --- .../version-3.8.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-3.8.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-3.8.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-3.8.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-3.8.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-3.8.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-3.8.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-3.8.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-3.8.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-3.8.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/clone.mdx | 34 --- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../RsaHashedImportParams.mdx | 18 -- .../version-3.8.0/globals/Set/@@species.mdx | 25 -- .../version-3.8.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-3.8.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-3.8.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 99 -------- .../globals/SubtleCrypto/prototype/sign.mdx | 60 ----- .../globals/SubtleCrypto/prototype/verify.mdx | 52 ---- .../version-3.8.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-3.8.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-3.8.0/globals/Symbol/iterator.mdx | 26 -- .../version-3.8.0/globals/Symbol/keyFor.mdx | 25 -- .../version-3.8.0/globals/Symbol/match.mdx | 19 -- .../version-3.8.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-3.8.0/globals/Symbol/replace.mdx | 15 -- .../version-3.8.0/globals/Symbol/search.mdx | 15 -- .../version-3.8.0/globals/Symbol/species.mdx | 21 -- .../version-3.8.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-3.8.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-3.8.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-3.8.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-3.8.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-3.8.0/globals/atob.mdx | 37 --- .../version-3.8.0/globals/btoa.mdx | 38 --- .../version-3.8.0/globals/clearInterval.mdx | 35 --- .../version-3.8.0/globals/clearTimeout.mdx | 36 --- .../version-3.8.0/globals/console/assert.mdx | 42 ---- .../version-3.8.0/globals/console/clear.mdx | 24 -- .../version-3.8.0/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-3.8.0/globals/console/debug.mdx | 26 -- .../version-3.8.0/globals/console/dir.mdx | 26 -- .../version-3.8.0/globals/console/dirxml.mdx | 25 -- .../version-3.8.0/globals/console/error.mdx | 26 -- .../version-3.8.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-3.8.0/globals/console/info.mdx | 26 -- .../version-3.8.0/globals/console/log.mdx | 30 --- .../version-3.8.0/globals/console/time.mdx | 29 --- .../version-3.8.0/globals/console/timeEnd.mdx | 26 -- .../version-3.8.0/globals/console/timeLog.mdx | 26 -- .../version-3.8.0/globals/console/trace.mdx | 27 --- .../version-3.8.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-3.8.0/globals/crypto/subtle.mdx | 16 -- .../version-3.8.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-3.8.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-3.8.0/globals/escape.mdx | 34 --- .../version-3.8.0/globals/eval.mdx | 36 --- .../version-3.8.0/globals/fetch.mdx | 65 ----- .../version-3.8.0/globals/globalThis.mdx | 20 -- .../version-3.8.0/globals/isFinite.mdx | 37 --- .../version-3.8.0/globals/isNaN.mdx | 36 --- .../version-3.8.0/globals/location.mdx | 18 -- .../version-3.8.0/globals/parseFloat.mdx | 41 ---- .../version-3.8.0/globals/parseInt.mdx | 68 ------ .../version-3.8.0/globals/performance/now.mdx | 25 -- .../globals/performance/timeOrigin.mdx | 16 -- .../version-3.8.0/globals/setInterval.mdx | 61 ----- .../version-3.8.0/globals/setTimeout.mdx | 61 ----- .../version-3.8.0/globals/structuredClone.mdx | 33 --- .../version-3.8.0/globals/undefined.mdx | 25 -- .../version-3.8.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-3.8.0/index.mdx | 98 -------- .../version-3.8.0/migration-guide/index.mdx | 98 -------- .../fastly:backend/Backend/Backend.mdx | 227 ------------------ .../fastly:backend/Backend/exists.mdx | 20 -- .../fastly:backend/Backend/fromName.mdx | 20 -- .../fastly:backend/Backend/health.mdx | 25 -- .../Backend/prototype/toName.mdx | 20 -- .../Backend/prototype/toString.mdx | 87 ------- .../CacheOverride/CacheOverride.mdx | 132 ---------- .../fastly:cache/SimpleCache/SimpleCache.mdx | 47 ---- .../fastly:cache/SimpleCache/get.mdx | 58 ----- .../fastly:cache/SimpleCache/getOrSet.mdx | 81 ------- .../fastly:cache/SimpleCache/purge.mdx | 81 ------- .../SimpleCacheEntry/arrayBuffer.mdx | 25 -- .../fastly:cache/SimpleCacheEntry/body.mdx | 14 -- .../SimpleCacheEntry/bodyUsed.mdx | 13 - .../fastly:cache/SimpleCacheEntry/json.mdx | 28 --- .../fastly:cache/SimpleCacheEntry/text.mdx | 26 -- .../ConfigStore/ConfigStore.mdx | 96 -------- .../ConfigStore/prototype/get.mdx | 97 -------- .../Dictionary/Dictionary.mdx | 96 -------- .../Dictionary/prototype/get.mdx | 101 -------- .../version-3.9.0/fastly:env/env.mdx | 93 ------- .../allowDynamicBackends.mdx | 88 ------- .../fastly:experimental/includeBytes.mdx | 40 --- .../fastly:fanout/createFanoutHandoff.mdx | 53 ---- .../getGeolocationForIpAddress.mdx | 178 -------------- .../fastly:kv-store/KVStore/KVStore.mdx | 62 ----- .../fastly:kv-store/KVStore/prototype/get.mdx | 68 ------ .../fastly:kv-store/KVStore/prototype/put.mdx | 68 ------ .../KVStoreEntry/prototype/arrayBuffer.mdx | 23 -- .../KVStoreEntry/prototype/body.mdx | 14 -- .../KVStoreEntry/prototype/bodyUsed.mdx | 14 -- .../KVStoreEntry/prototype/json.mdx | 26 -- .../KVStoreEntry/prototype/text.mdx | 24 -- .../fastly:logger/Logger/Logger.mdx | 89 ------- .../fastly:logger/Logger/prototype/log.mdx | 89 ------- .../SecretStore/SecretStore.mdx | 63 ----- .../SecretStore/prototype/get.mdx | 69 ------ .../SecretStoreEntry/prototype/plaintext.mdx | 55 ----- .../AggregrateError/AggregrateError.mdx | 35 --- .../version-3.9.0/globals/Array/@@species.mdx | 57 ----- .../version-3.9.0/globals/Array/Array.mdx | 41 ---- .../version-3.9.0/globals/Array/from.mdx | 62 ----- .../version-3.9.0/globals/Array/isArray.mdx | 32 --- .../version-3.9.0/globals/Array/of.mdx | 41 ---- .../globals/Array/prototype/@@iterator.mdx | 21 -- .../globals/Array/prototype/@@unscopables.mdx | 33 --- .../globals/Array/prototype/at.mdx | 32 --- .../globals/Array/prototype/concat.mdx | 41 ---- .../globals/Array/prototype/copyWithin.mdx | 54 ----- .../globals/Array/prototype/entries.mdx | 27 --- .../globals/Array/prototype/every.mdx | 70 ------ .../globals/Array/prototype/fill.mdx | 46 ---- .../globals/Array/prototype/filter.mdx | 64 ----- .../globals/Array/prototype/find.mdx | 73 ------ .../globals/Array/prototype/findIndex.mdx | 67 ------ .../globals/Array/prototype/flat.mdx | 35 --- .../globals/Array/prototype/flatMap.mdx | 57 ----- .../globals/Array/prototype/forEach.mdx | 70 ------ .../globals/Array/prototype/includes.mdx | 40 --- .../globals/Array/prototype/indexOf.mdx | 39 --- .../globals/Array/prototype/join.mdx | 43 ---- .../globals/Array/prototype/keys.mdx | 26 -- .../globals/Array/prototype/lastIndexOf.mdx | 40 --- .../globals/Array/prototype/length.mdx | 40 --- .../globals/Array/prototype/map.mdx | 72 ------ .../globals/Array/prototype/pop.mdx | 31 --- .../globals/Array/prototype/push.mdx | 37 --- .../globals/Array/prototype/reduce.mdx | 125 ---------- .../globals/Array/prototype/reduceRight.mdx | 79 ------ .../globals/Array/prototype/reverse.mdx | 28 --- .../globals/Array/prototype/shift.mdx | 33 --- .../globals/Array/prototype/slice.mdx | 46 ---- .../globals/Array/prototype/some.mdx | 68 ------ .../globals/Array/prototype/sort.mdx | 110 --------- .../globals/Array/prototype/splice.mdx | 59 ----- .../Array/prototype/toLocaleString.mdx | 42 ---- .../globals/Array/prototype/toString.mdx | 35 --- .../globals/Array/prototype/unshift.mdx | 62 ----- .../globals/Array/prototype/values.mdx | 31 --- .../globals/ArrayBuffer/@@species.mdx | 43 ---- .../globals/ArrayBuffer/ArrayBuffer.mdx | 32 --- .../globals/ArrayBuffer/isView.mdx | 28 --- .../ArrayBuffer/prototype/byteLength.mdx | 13 - .../globals/ArrayBuffer/prototype/slice.mdx | 43 ---- .../version-3.9.0/globals/BigInt/BigInt.mdx | 37 --- .../version-3.9.0/globals/BigInt/asIntN.mdx | 53 ---- .../version-3.9.0/globals/BigInt/asUintN.mdx | 45 ---- .../BigInt/prototype/toLocaleString.mdx | 49 ---- .../globals/BigInt/prototype/toString.mdx | 49 ---- .../globals/BigInt/prototype/valueOf.mdx | 20 -- .../globals/BigInt64Array/BigInt64Array.mdx | 37 --- .../globals/BigUint64Array/BigUint64Array.mdx | 37 --- .../version-3.9.0/globals/Boolean/Boolean.mdx | 37 --- .../globals/Boolean/prototype/toString.mdx | 34 --- .../globals/Boolean/prototype/valueOf.mdx | 27 --- .../ByteLengthQueuingStrategy.mdx | 31 --- .../prototype/size.mdx | 26 -- .../CompressionStream/CompressionStream.mdx | 30 --- .../CompressionStream/prototype/readable.mdx | 13 - .../CompressionStream/prototype/writable.mdx | 13 - .../globals/CryptoKey/CryptoKey.mdx | 23 -- .../globals/CryptoKey/prototype/algorithm.mdx | 18 -- .../CryptoKey/prototype/extractable.mdx | 16 -- .../globals/CryptoKey/prototype/type.mdx | 18 -- .../globals/CryptoKey/prototype/usages.mdx | 23 -- .../globals/DOMException/DOMException.mdx | 107 --------- .../globals/DOMException/code.mdx | 16 -- .../globals/DOMException/message.mdx | 14 -- .../globals/DOMException/name.mdx | 14 -- .../globals/DataView/DataView.mdx | 46 ---- .../globals/DataView/prototype/buffer.mdx | 13 - .../globals/DataView/prototype/byteLength.mdx | 13 - .../globals/DataView/prototype/byteOffset.mdx | 13 - .../DataView/prototype/getBigInt64.mdx | 39 --- .../DataView/prototype/getBigUint64.mdx | 40 --- .../globals/DataView/prototype/getFloat32.mdx | 40 --- .../globals/DataView/prototype/getFloat64.mdx | 40 --- .../globals/DataView/prototype/getInt16.mdx | 40 --- .../globals/DataView/prototype/getInt32.mdx | 40 --- .../globals/DataView/prototype/getInt8.mdx | 35 --- .../globals/DataView/prototype/getUint16.mdx | 43 ---- .../globals/DataView/prototype/getUint32.mdx | 43 ---- .../globals/DataView/prototype/getUint8.mdx | 36 --- .../DataView/prototype/setBigInt64.mdx | 41 ---- .../DataView/prototype/setBigUint64.mdx | 42 ---- .../globals/DataView/prototype/setFloat32.mdx | 38 --- .../globals/DataView/prototype/setFloat64.mdx | 39 --- .../globals/DataView/prototype/setInt16.mdx | 38 --- .../globals/DataView/prototype/setInt32.mdx | 38 --- .../globals/DataView/prototype/setInt8.mdx | 33 --- .../globals/DataView/prototype/setUint16.mdx | 39 --- .../globals/DataView/prototype/setUint32.mdx | 39 --- .../globals/DataView/prototype/setUint8.mdx | 33 --- .../version-3.9.0/globals/Date/Date.mdx | 88 ------- .../version-3.9.0/globals/Date/UTC.mdx | 84 ------- .../version-3.9.0/globals/Date/now.mdx | 19 -- .../version-3.9.0/globals/Date/parse.mdx | 123 ---------- .../globals/Date/prototype/@@toPrimitive.mdx | 40 --- .../globals/Date/prototype/getDate.mdx | 21 -- .../globals/Date/prototype/getDay.mdx | 22 -- .../globals/Date/prototype/getFullYear.mdx | 29 --- .../globals/Date/prototype/getHours.mdx | 21 -- .../Date/prototype/getMilliseconds.mdx | 21 -- .../globals/Date/prototype/getMinutes.mdx | 21 -- .../globals/Date/prototype/getMonth.mdx | 22 -- .../globals/Date/prototype/getSeconds.mdx | 21 -- .../globals/Date/prototype/getTime.mdx | 44 ---- .../Date/prototype/getTimezoneOffset.mdx | 41 ---- .../globals/Date/prototype/getUTCDate.mdx | 24 -- .../globals/Date/prototype/getUTCDay.mdx | 25 -- .../globals/Date/prototype/getUTCFullYear.mdx | 29 --- .../globals/Date/prototype/getUTCHours.mdx | 24 -- .../Date/prototype/getUTCMilliseconds.mdx | 27 --- .../globals/Date/prototype/getUTCMinutes.mdx | 24 -- .../globals/Date/prototype/getUTCMonth.mdx | 24 -- .../globals/Date/prototype/getUTCSeconds.mdx | 24 -- .../globals/Date/prototype/getYear.mdx | 36 --- .../globals/Date/prototype/setDate.mdx | 35 --- .../globals/Date/prototype/setFullYear.mdx | 47 ---- .../globals/Date/prototype/setHours.mdx | 57 ----- .../Date/prototype/setMilliseconds.mdx | 31 --- .../globals/Date/prototype/setMinutes.mdx | 48 ---- .../globals/Date/prototype/setMonth.mdx | 45 ---- .../globals/Date/prototype/setSeconds.mdx | 40 --- .../globals/Date/prototype/setTime.mdx | 32 --- .../globals/Date/prototype/setUTCDate.mdx | 34 --- .../globals/Date/prototype/setUTCFullYear.mdx | 47 ---- .../globals/Date/prototype/setUTCHours.mdx | 53 ---- .../Date/prototype/setUTCMilliseconds.mdx | 33 --- .../globals/Date/prototype/setUTCMinutes.mdx | 49 ---- .../globals/Date/prototype/setUTCMonth.mdx | 38 --- .../globals/Date/prototype/setUTCSeconds.mdx | 40 --- .../globals/Date/prototype/setYear.mdx | 38 --- .../globals/Date/prototype/toDateString.mdx | 35 --- .../globals/Date/prototype/toISOString.mdx | 19 -- .../globals/Date/prototype/toJSON.mdx | 28 --- .../Date/prototype/toLocaleDateString.mdx | 47 ---- .../globals/Date/prototype/toLocaleString.mdx | 43 ---- .../Date/prototype/toLocaleTimeString.mdx | 47 ---- .../globals/Date/prototype/toString.mdx | 34 --- .../globals/Date/prototype/toTimeString.mdx | 38 --- .../globals/Date/prototype/toUTCString.mdx | 43 ---- .../globals/Date/prototype/valueOf.mdx | 33 --- .../DecompressionStream.mdx | 30 --- .../prototype/readable.mdx | 13 - .../prototype/writable.mdx | 13 - .../EcKeyImportParams/EcKeyImportParams.mdx | 21 -- .../globals/EcdsaParams/EcdsaParams.mdx | 24 -- .../version-3.9.0/globals/Error/Error.mdx | 36 --- .../globals/Error/prototype/cause.mdx | 19 -- .../globals/Error/prototype/message.mdx | 19 -- .../globals/Error/prototype/name.mdx | 17 -- .../globals/Error/prototype/toString.mdx | 25 -- .../globals/EvalError/EvalError.mdx | 37 --- .../globals/FetchEvent/FetchEvent.mdx | 38 --- .../FetchEvent/prototype/respondWith.mdx | 25 -- .../FetchEvent/prototype/waitUntil.mdx | 29 --- .../FinalizationRegistry.mdx | 29 --- .../prototype/register.mdx | 47 ---- .../prototype/unregister.mdx | 37 --- .../globals/Float32Array/Float32Array.mdx | 38 --- .../globals/Float64Array/Float64Array.mdx | 38 --- .../globals/Function/Function.mdx | 75 ------ .../globals/Function/prototype/apply.mdx | 37 --- .../globals/Function/prototype/bind.mdx | 87 ------- .../globals/Function/prototype/call.mdx | 36 --- .../globals/Function/prototype/index.mdx | 71 ------ .../globals/Function/prototype/length.mdx | 21 -- .../globals/Function/prototype/name.mdx | 214 ----------------- .../globals/Function/prototype/toString.mdx | 60 ----- .../version-3.9.0/globals/Headers/Headers.mdx | 24 -- .../globals/Headers/prototype/append.mdx | 33 --- .../globals/Headers/prototype/delete.mdx | 29 --- .../globals/Headers/prototype/entries.mdx | 24 -- .../globals/Headers/prototype/forEach.mdx | 43 ---- .../globals/Headers/prototype/get.mdx | 30 --- .../globals/Headers/prototype/has.mdx | 27 --- .../globals/Headers/prototype/keys.mdx | 24 -- .../globals/Headers/prototype/set.mdx | 34 --- .../globals/Headers/prototype/values.mdx | 24 -- .../HmacImportParams/HmacImportParams.mdx | 21 -- .../version-3.9.0/globals/Infinity.mdx | 21 -- .../globals/Int16Array/Int16Array.mdx | 37 --- .../globals/Int32Array/Int32Array.mdx | 37 --- .../globals/Int8Array/Int8Array.mdx | 35 --- .../version-3.9.0/globals/JSON/parse.mdx | 50 ---- .../version-3.9.0/globals/JSON/stringify.mdx | 96 -------- .../version-3.9.0/globals/Map/@@species.mdx | 25 -- .../version-3.9.0/globals/Map/Map.mdx | 27 --- .../globals/Map/prototype/@@iterator.mdx | 21 -- .../globals/Map/prototype/clear.mdx | 19 -- .../globals/Map/prototype/delete.mdx | 26 -- .../globals/Map/prototype/entries.mdx | 24 -- .../globals/Map/prototype/forEach.mdx | 73 ------ .../globals/Map/prototype/get.mdx | 28 --- .../globals/Map/prototype/has.mdx | 26 -- .../globals/Map/prototype/keys.mdx | 21 -- .../globals/Map/prototype/set.mdx | 26 -- .../globals/Map/prototype/size.mdx | 16 -- .../globals/Map/prototype/values.mdx | 22 -- .../version-3.9.0/globals/Math/E.mdx | 17 -- .../version-3.9.0/globals/Math/LN10.mdx | 17 -- .../version-3.9.0/globals/Math/LN2.mdx | 17 -- .../version-3.9.0/globals/Math/LOG10e.mdx | 17 -- .../version-3.9.0/globals/Math/LOG2e.mdx | 17 -- .../version-3.9.0/globals/Math/PI.mdx | 17 -- .../version-3.9.0/globals/Math/SQRT1_2.mdx | 19 -- .../version-3.9.0/globals/Math/SQRT2.mdx | 19 -- .../version-3.9.0/globals/Math/abs.mdx | 29 --- .../version-3.9.0/globals/Math/acos.mdx | 28 --- .../version-3.9.0/globals/Math/acosh.mdx | 28 --- .../version-3.9.0/globals/Math/asin.mdx | 28 --- .../version-3.9.0/globals/Math/asinh.mdx | 28 --- .../version-3.9.0/globals/Math/atan.mdx | 28 --- .../version-3.9.0/globals/Math/atan2.mdx | 51 ---- .../version-3.9.0/globals/Math/atanh.mdx | 29 --- .../version-3.9.0/globals/Math/cbrt.mdx | 28 --- .../version-3.9.0/globals/Math/ceil.mdx | 28 --- .../version-3.9.0/globals/Math/clz32.mdx | 34 --- .../version-3.9.0/globals/Math/cos.mdx | 28 --- .../version-3.9.0/globals/Math/cosh.mdx | 28 --- .../version-3.9.0/globals/Math/exp.mdx | 30 --- .../version-3.9.0/globals/Math/expm1.mdx | 32 --- .../version-3.9.0/globals/Math/floor.mdx | 28 --- .../version-3.9.0/globals/Math/fround.mdx | 32 --- .../version-3.9.0/globals/Math/hypot.mdx | 39 --- .../version-3.9.0/globals/Math/imul.mdx | 35 --- .../version-3.9.0/globals/Math/log.mdx | 32 --- .../version-3.9.0/globals/Math/log10.mdx | 30 --- .../version-3.9.0/globals/Math/log1p.mdx | 34 --- .../version-3.9.0/globals/Math/log2.mdx | 30 --- .../version-3.9.0/globals/Math/max.mdx | 33 --- .../version-3.9.0/globals/Math/min.mdx | 33 --- .../version-3.9.0/globals/Math/pow.mdx | 39 --- .../version-3.9.0/globals/Math/random.mdx | 21 -- .../version-3.9.0/globals/Math/round.mdx | 34 --- .../version-3.9.0/globals/Math/sign.mdx | 34 --- .../version-3.9.0/globals/Math/sin.mdx | 28 --- .../version-3.9.0/globals/Math/sinh.mdx | 29 --- .../version-3.9.0/globals/Math/sqrt.mdx | 29 --- .../version-3.9.0/globals/Math/tan.mdx | 31 --- .../version-3.9.0/globals/Math/tanh.mdx | 28 --- .../version-3.9.0/globals/Math/trunc.mdx | 30 --- .../version-3.9.0/globals/NaN.mdx | 35 --- .../globals/Number/MAX_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MAX_VALUE.mdx | 19 -- .../globals/Number/MIN_SAFE_INTEGER.mdx | 21 -- .../globals/Number/MIN_VALUE.mdx | 21 -- .../globals/Number/NEGATIVE_INFINITY.mdx | 32 --- .../version-3.9.0/globals/Number/NaN.mdx | 17 -- .../version-3.9.0/globals/Number/Number.mdx | 31 --- .../globals/Number/POSITIVE_INFINITY.mdx | 32 --- .../version-3.9.0/globals/Number/epsilon.mdx | 21 -- .../version-3.9.0/globals/Number/isFinite.mdx | 24 -- .../globals/Number/isInteger.mdx | 32 --- .../version-3.9.0/globals/Number/isNaN.mdx | 32 --- .../globals/Number/isSafeInteger.mdx | 37 --- .../globals/Number/parseFloat.mdx | 26 -- .../version-3.9.0/globals/Number/parseInt.mdx | 37 --- .../Number/prototype/toExponential.mdx | 54 ----- .../globals/Number/prototype/toFixed.mdx | 51 ---- .../Number/prototype/toLocaleString.mdx | 49 ---- .../globals/Number/prototype/toPrecision.mdx | 41 ---- .../globals/Number/prototype/toString.mdx | 58 ----- .../globals/Number/prototype/valueOf.mdx | 24 -- .../version-3.9.0/globals/Object/Object.mdx | 27 --- .../version-3.9.0/globals/Object/assign.mdx | 57 ----- .../version-3.9.0/globals/Object/create.mdx | 32 --- .../globals/Object/defineProperties.mdx | 71 ------ .../globals/Object/defineProperty.mdx | 149 ------------ .../version-3.9.0/globals/Object/entries.mdx | 30 --- .../version-3.9.0/globals/Object/freeze.mdx | 66 ----- .../globals/Object/fromEntries.mdx | 40 --- .../Object/getOwnPropertyDescriptor.mdx | 60 ----- .../Object/getOwnPropertyDescriptors.mdx | 54 ----- .../globals/Object/getOwnPropertyNames.mdx | 28 --- .../globals/Object/getOwnPropertySymbols.mdx | 30 --- .../globals/Object/getPrototypeOf.mdx | 26 -- .../version-3.9.0/globals/Object/hasOwn.mdx | 46 ---- .../version-3.9.0/globals/Object/is.mdx | 48 ---- .../globals/Object/isExtensible.mdx | 29 --- .../version-3.9.0/globals/Object/isFrozen.mdx | 31 --- .../version-3.9.0/globals/Object/isSealed.mdx | 32 --- .../version-3.9.0/globals/Object/keys.mdx | 30 --- .../globals/Object/preventExtensions.mdx | 43 ---- .../globals/Object/prototype/constructor.mdx | 48 ---- .../Object/prototype/hasOwnProperty.mdx | 54 ----- .../Object/prototype/isPrototypeOf.mdx | 35 --- .../Object/prototype/propertyIsEnumerable.mdx | 30 --- .../Object/prototype/toLocaleString.mdx | 34 --- .../globals/Object/prototype/toString.mdx | 55 ----- .../globals/Object/prototype/valueOf.mdx | 35 --- .../version-3.9.0/globals/Object/seal.mdx | 38 --- .../globals/Object/setPrototypeOf.mdx | 50 ---- .../version-3.9.0/globals/Object/values.mdx | 30 --- .../globals/Promise/@@species.mdx | 43 ---- .../version-3.9.0/globals/Promise/Promise.mdx | 140 ----------- .../version-3.9.0/globals/Promise/all.mdx | 34 --- .../globals/Promise/allSettled.mdx | 42 ---- .../version-3.9.0/globals/Promise/any.mdx | 36 --- .../globals/Promise/prototype/catch.mdx | 66 ----- .../globals/Promise/prototype/finally.mdx | 60 ----- .../globals/Promise/prototype/then.mdx | 53 ---- .../version-3.9.0/globals/Promise/race.mdx | 30 --- .../version-3.9.0/globals/Promise/reject.mdx | 32 --- .../version-3.9.0/globals/Promise/resolve.mdx | 39 --- .../version-3.9.0/globals/Proxy/Proxy.mdx | 74 ------ .../globals/Proxy/proxy/apply.mdx | 53 ---- .../globals/Proxy/proxy/construct.mdx | 52 ---- .../globals/Proxy/proxy/defineProperty.mdx | 66 ----- .../globals/Proxy/proxy/deleteProperty.mdx | 54 ----- .../version-3.9.0/globals/Proxy/proxy/get.mdx | 60 ----- .../Proxy/proxy/getOwnPropertyDescriptor.mdx | 57 ----- .../globals/Proxy/proxy/getPrototypeOf.mdx | 54 ----- .../version-3.9.0/globals/Proxy/proxy/has.mdx | 55 ----- .../globals/Proxy/proxy/isExtensible.mdx | 52 ---- .../globals/Proxy/proxy/ownKeys.mdx | 58 ----- .../globals/Proxy/proxy/preventExtensions.mdx | 50 ---- .../version-3.9.0/globals/Proxy/proxy/set.mdx | 77 ------ .../globals/Proxy/proxy/setPrototypeOf.mdx | 56 ----- .../version-3.9.0/globals/Proxy/revocable.mdx | 41 ---- .../globals/RangeError/RangeError.mdx | 38 --- .../prototype/byobRequest.mdx | 17 -- .../prototype/close.mdx | 34 --- .../prototype/desiredSize.mdx | 21 -- .../prototype/enqueue.mdx | 33 --- .../prototype/error.mdx | 34 --- .../globals/ReadableStream/ReadableStream.mdx | 93 ------- .../ReadableStream/prototype/cancel.mdx | 38 --- .../ReadableStream/prototype/getReader.mdx | 42 ---- .../ReadableStream/prototype/locked.mdx | 16 -- .../ReadableStream/prototype/pipeThrough.mdx | 61 ----- .../ReadableStream/prototype/pipeTo.mdx | 50 ---- .../globals/ReadableStream/prototype/tee.mdx | 57 ----- .../ReadableStreamBYOBReader.mdx | 33 --- .../prototype/cancel.mdx | 34 --- .../prototype/closed.mdx | 16 -- .../prototype/read.mdx | 73 ------ .../prototype/releaseLock.mdx | 35 --- .../prototype/respond.mdx | 32 --- .../prototype/respondWithNewView.mdx | 46 ---- .../prototype/view.mdx | 17 -- .../prototype/close.mdx | 35 --- .../prototype/desiredSize.mdx | 15 -- .../prototype/enqueue.mdx | 31 --- .../prototype/error.mdx | 34 --- .../ReadableStreamDefaultReader.mdx | 32 --- .../prototype/cancel.mdx | 43 ---- .../prototype/closed.mdx | 17 -- .../prototype/read.mdx | 33 --- .../prototype/releaseLock.mdx | 33 --- .../globals/ReferenceError/ReferenceError.mdx | 38 --- .../version-3.9.0/globals/Reflect/apply.mdx | 48 ---- .../globals/Reflect/construct.mdx | 135 ----------- .../globals/Reflect/defineProperty.mdx | 46 ---- .../globals/Reflect/deleteProperty.mdx | 43 ---- .../version-3.9.0/globals/Reflect/get.mdx | 43 ---- .../Reflect/getOwnPropertyDescriptor.mdx | 45 ---- .../globals/Reflect/getPrototypeOf.mdx | 39 --- .../version-3.9.0/globals/Reflect/has.mdx | 39 --- .../globals/Reflect/isExtensible.mdx | 28 --- .../version-3.9.0/globals/Reflect/ownKeys.mdx | 37 --- .../globals/Reflect/preventExtensions.mdx | 28 --- .../version-3.9.0/globals/Reflect/set.mdx | 43 ---- .../globals/Reflect/setPrototypeOf.mdx | 43 ---- .../version-3.9.0/globals/Request/Request.mdx | 54 ----- .../globals/Request/prototype/arrayBuffer.mdx | 24 -- .../globals/Request/prototype/body.mdx | 17 -- .../globals/Request/prototype/bodyUsed.mdx | 15 -- .../globals/Request/prototype/clone.mdx | 34 --- .../globals/Request/prototype/headers.mdx | 15 -- .../globals/Request/prototype/json.mdx | 27 --- .../globals/Request/prototype/method.mdx | 14 -- .../prototype/setManualFramingHeaders.mdx | 35 --- .../globals/Request/prototype/text.mdx | 25 -- .../globals/Request/prototype/url.mdx | 14 -- .../globals/Response/Response.mdx | 55 ----- .../Response/prototype/arrayBuffer.mdx | 25 -- .../globals/Response/prototype/body.mdx | 14 -- .../globals/Response/prototype/bodyUsed.mdx | 13 - .../globals/Response/prototype/headers.mdx | 15 -- .../globals/Response/prototype/json.mdx | 28 --- .../globals/Response/prototype/ok.mdx | 13 - .../globals/Response/prototype/status.mdx | 15 -- .../globals/Response/prototype/statusText.mdx | 16 -- .../globals/Response/prototype/text.mdx | 26 -- .../globals/Response/prototype/url.mdx | 15 -- .../globals/Response/redirect.mdx | 35 --- .../Response/setManualFramingHeaders.mdx | 35 --- .../RsaHashedImportParams.mdx | 18 -- .../version-3.9.0/globals/Set/@@species.mdx | 25 -- .../version-3.9.0/globals/Set/Set.mdx | 34 --- .../globals/Set/prototype/@@iterator.mdx | 21 -- .../globals/Set/prototype/add.mdx | 24 -- .../globals/Set/prototype/clear.mdx | 20 -- .../globals/Set/prototype/delete.mdx | 26 -- .../globals/Set/prototype/entries.mdx | 26 -- .../globals/Set/prototype/forEach.mdx | 82 ------- .../globals/Set/prototype/has.mdx | 25 -- .../globals/Set/prototype/keys.mdx | 20 -- .../globals/Set/prototype/size.mdx | 13 - .../globals/Set/prototype/values.mdx | 26 -- .../version-3.9.0/globals/String/String.mdx | 34 --- .../globals/String/fromCharCode.mdx | 38 --- .../globals/String/fromCodePoint.mdx | 40 --- .../globals/String/prototype/@@iterator.mdx | 34 --- .../globals/String/prototype/at.mdx | 24 -- .../globals/String/prototype/charAt.mdx | 42 ---- .../globals/String/prototype/charCodeAt.mdx | 65 ----- .../globals/String/prototype/codePointAt.mdx | 32 --- .../globals/String/prototype/concat.mdx | 38 --- .../globals/String/prototype/endsWith.mdx | 36 --- .../globals/String/prototype/includes.mdx | 50 ---- .../globals/String/prototype/indexOf.mdx | 91 ------- .../globals/String/prototype/lastIndexOf.mdx | 62 ----- .../globals/String/prototype/length.mdx | 39 --- .../String/prototype/localeCompare.mdx | 67 ------ .../globals/String/prototype/match.mdx | 42 ---- .../globals/String/prototype/matchAll.mdx | 38 --- .../globals/String/prototype/padEnd.mdx | 38 --- .../globals/String/prototype/padStart.mdx | 36 --- .../globals/String/prototype/repeat.mdx | 33 --- .../globals/String/prototype/replace.mdx | 112 --------- .../globals/String/prototype/replaceAll.mdx | 66 ----- .../globals/String/prototype/search.mdx | 38 --- .../globals/String/prototype/slice.mdx | 41 ---- .../globals/String/prototype/split.mdx | 53 ---- .../globals/String/prototype/startsWith.mdx | 36 --- .../globals/String/prototype/substr.mdx | 44 ---- .../globals/String/prototype/substring.mdx | 39 --- .../String/prototype/toLocaleLowerCase.mdx | 42 ---- .../String/prototype/toLocaleUpperCase.mdx | 49 ---- .../globals/String/prototype/toLowerCase.mdx | 26 -- .../globals/String/prototype/toString.mdx | 34 --- .../globals/String/prototype/toUpperCase.mdx | 32 --- .../globals/String/prototype/trim.mdx | 23 -- .../globals/String/prototype/trimEnd.mdx | 31 --- .../globals/String/prototype/trimStart.mdx | 31 --- .../globals/String/prototype/valueOf.mdx | 28 --- .../version-3.9.0/globals/String/raw.mdx | 45 ---- .../globals/SubtleCrypto/SubtleCrypto.mdx | 18 -- .../globals/SubtleCrypto/prototype/digest.mdx | 45 ---- .../SubtleCrypto/prototype/importKey.mdx | 99 -------- .../globals/SubtleCrypto/prototype/sign.mdx | 60 ----- .../globals/SubtleCrypto/prototype/verify.mdx | 52 ---- .../version-3.9.0/globals/Symbol/Symbol.mdx | 31 --- .../globals/Symbol/asyncIterator.mdx | 17 -- .../version-3.9.0/globals/Symbol/for.mdx | 37 --- .../globals/Symbol/hasInstance.mdx | 13 - .../globals/Symbol/isConcatSpreadable.mdx | 20 -- .../version-3.9.0/globals/Symbol/iterator.mdx | 26 -- .../version-3.9.0/globals/Symbol/keyFor.mdx | 25 -- .../version-3.9.0/globals/Symbol/match.mdx | 19 -- .../version-3.9.0/globals/Symbol/matchAll.mdx | 15 -- .../Symbol/prototype/@@toPrimitive.mdx | 31 --- .../globals/Symbol/prototype/description.mdx | 13 - .../globals/Symbol/prototype/toString.mdx | 28 --- .../globals/Symbol/prototype/valueOf.mdx | 25 -- .../version-3.9.0/globals/Symbol/replace.mdx | 15 -- .../version-3.9.0/globals/Symbol/search.mdx | 15 -- .../version-3.9.0/globals/Symbol/species.mdx | 21 -- .../version-3.9.0/globals/Symbol/split.mdx | 15 -- .../globals/Symbol/toPrimitive.mdx | 21 -- .../globals/Symbol/toStringTag.mdx | 13 - .../globals/Symbol/unscopables.mdx | 21 -- .../globals/SyntaxError/SyntaxError.mdx | 38 --- .../globals/TextDecoder/TextDecoder.mdx | 38 --- .../globals/TextDecoder/prototype/decode.mdx | 42 ---- .../TextDecoder/prototype/encoding.mdx | 65 ----- .../globals/TextDecoder/prototype/fatal.mdx | 18 -- .../TextDecoder/prototype/ignoreBOM.mdx | 13 - .../globals/TextEncoder/TextEncoder.mdx | 19 -- .../globals/TextEncoder/prototype/encode.mdx | 24 -- .../TextEncoder/prototype/encoding.mdx | 16 -- .../TransformStream/TransformStream.mdx | 62 ----- .../TransformStream/prototype/readable.mdx | 13 - .../TransformStream/prototype/writable.mdx | 13 - .../prototype/desiredSize.mdx | 17 -- .../prototype/enqueue.mdx | 30 --- .../prototype/error.mdx | 24 -- .../prototype/terminate.mdx | 23 -- .../globals/TypeError/TypeError.mdx | 39 --- .../globals/URIError/URIError.mdx | 38 --- .../version-3.9.0/globals/URL/URL.mdx | 38 --- .../globals/URL/prototype/hash.mdx | 18 -- .../globals/URL/prototype/host.mdx | 15 -- .../globals/URL/prototype/hostname.mdx | 14 -- .../globals/URL/prototype/href.mdx | 15 -- .../globals/URL/prototype/origin.mdx | 28 --- .../globals/URL/prototype/password.mdx | 16 -- .../globals/URL/prototype/pathname.mdx | 21 -- .../globals/URL/prototype/port.mdx | 16 -- .../globals/URL/prototype/protocol.mdx | 15 -- .../globals/URL/prototype/search.mdx | 16 -- .../globals/URL/prototype/searchParams.mdx | 15 -- .../globals/URL/prototype/toJSON.mdx | 26 -- .../globals/URL/prototype/toString.mdx | 25 -- .../globals/URL/prototype/username.mdx | 15 -- .../URLSearchParams/URLSearchParams.mdx | 31 --- .../URLSearchParams/prototype/append.mdx | 30 --- .../URLSearchParams/prototype/delete.mdx | 26 -- .../URLSearchParams/prototype/entries.mdx | 27 --- .../URLSearchParams/prototype/forEach.mdx | 39 --- .../globals/URLSearchParams/prototype/get.mdx | 26 -- .../globals/URLSearchParams/prototype/has.mdx | 26 -- .../URLSearchParams/prototype/keys.mdx | 26 -- .../globals/URLSearchParams/prototype/set.mdx | 29 --- .../URLSearchParams/prototype/sort.mdx | 27 --- .../URLSearchParams/prototype/toString.mdx | 26 -- .../URLSearchParams/prototype/values.mdx | 26 -- .../globals/Uint16Array/Uint16Array.mdx | 33 --- .../globals/Uint32Array/Uint32Array.mdx | 37 --- .../globals/Uint8Array/Uint8Array.mdx | 35 --- .../Uint8ClampedArray/Uint8ClampedArray.mdx | 37 --- .../version-3.9.0/globals/WeakMap/WeakMap.mdx | 23 -- .../globals/WeakMap/prototype/delete.mdx | 27 --- .../globals/WeakMap/prototype/get.mdx | 26 -- .../globals/WeakMap/prototype/has.mdx | 28 --- .../globals/WeakMap/prototype/set.mdx | 29 --- .../version-3.9.0/globals/WeakRef/WeakRef.mdx | 23 -- .../globals/WeakRef/prototype/deref.mdx | 25 -- .../version-3.9.0/globals/WeakSet/WeakSet.mdx | 25 -- .../globals/WeakSet/prototype/add.mdx | 25 -- .../globals/WeakSet/prototype/delete.mdx | 27 --- .../globals/WeakSet/prototype/has.mdx | 27 --- .../globals/WorkerLocation/WorkerLocation.mdx | 36 --- .../globals/WorkerLocation/hash.mdx | 13 - .../globals/WorkerLocation/host.mdx | 13 - .../globals/WorkerLocation/hostname.mdx | 13 - .../globals/WorkerLocation/href.mdx | 13 - .../globals/WorkerLocation/origin.mdx | 13 - .../globals/WorkerLocation/pathname.mdx | 13 - .../globals/WorkerLocation/port.mdx | 13 - .../globals/WorkerLocation/protocol.mdx | 13 - .../globals/WorkerLocation/search.mdx | 14 -- .../globals/WorkerLocation/toString.mdx | 23 -- .../globals/WritableStream/WritableStream.mdx | 80 ------ .../WritableStream/prototype/abort.mdx | 29 --- .../WritableStream/prototype/getWriter.mdx | 29 --- .../WritableStream/prototype/locked.mdx | 13 - .../WritableStreamDefaultController/error.mdx | 37 --- .../WritableStreamDefaultWriter.mdx | 31 --- .../prototype/abort.mdx | 40 --- .../prototype/close.mdx | 37 --- .../prototype/closed.mdx | 16 -- .../prototype/desiredSize.mdx | 24 -- .../prototype/ready.mdx | 16 -- .../prototype/releaseLock.mdx | 28 --- .../prototype/write.mdx | 39 --- .../version-3.9.0/globals/atob.mdx | 37 --- .../version-3.9.0/globals/btoa.mdx | 38 --- .../version-3.9.0/globals/clearInterval.mdx | 35 --- .../version-3.9.0/globals/clearTimeout.mdx | 36 --- .../version-3.9.0/globals/console/assert.mdx | 42 ---- .../version-3.9.0/globals/console/clear.mdx | 24 -- .../version-3.9.0/globals/console/count.mdx | 30 --- .../globals/console/countReset.mdx | 28 --- .../version-3.9.0/globals/console/debug.mdx | 26 -- .../version-3.9.0/globals/console/dir.mdx | 26 -- .../version-3.9.0/globals/console/dirxml.mdx | 25 -- .../version-3.9.0/globals/console/error.mdx | 26 -- .../version-3.9.0/globals/console/group.mdx | 26 -- .../globals/console/groupCollapsed.mdx | 30 --- .../globals/console/groupEnd.mdx | 24 -- .../version-3.9.0/globals/console/info.mdx | 26 -- .../version-3.9.0/globals/console/log.mdx | 30 --- .../version-3.9.0/globals/console/time.mdx | 29 --- .../version-3.9.0/globals/console/timeEnd.mdx | 26 -- .../version-3.9.0/globals/console/timeLog.mdx | 26 -- .../version-3.9.0/globals/console/trace.mdx | 27 --- .../version-3.9.0/globals/console/warn.mdx | 26 -- .../globals/crypto/getRandomValues.mdx | 35 --- .../globals/crypto/randomUUID.mdx | 23 -- .../version-3.9.0/globals/crypto/subtle.mdx | 16 -- .../version-3.9.0/globals/decodeURI.mdx | 41 ---- .../globals/decodeURIComponent.mdx | 36 --- .../version-3.9.0/globals/encodeURI.mdx | 51 ---- .../globals/encodeURIComponent.mdx | 43 ---- .../version-3.9.0/globals/escape.mdx | 34 --- .../version-3.9.0/globals/eval.mdx | 36 --- .../version-3.9.0/globals/fetch.mdx | 65 ----- .../version-3.9.0/globals/globalThis.mdx | 20 -- .../version-3.9.0/globals/isFinite.mdx | 37 --- .../version-3.9.0/globals/isNaN.mdx | 36 --- .../version-3.9.0/globals/location.mdx | 18 -- .../version-3.9.0/globals/parseFloat.mdx | 41 ---- .../version-3.9.0/globals/parseInt.mdx | 68 ------ .../version-3.9.0/globals/performance/now.mdx | 25 -- .../globals/performance/timeOrigin.mdx | 16 -- .../version-3.9.0/globals/setInterval.mdx | 61 ----- .../version-3.9.0/globals/setTimeout.mdx | 61 ----- .../version-3.9.0/globals/structuredClone.mdx | 33 --- .../version-3.9.0/globals/undefined.mdx | 25 -- .../version-3.9.0/globals/unescape.mdx | 34 --- .../versioned_docs/version-3.9.0/index.mdx | 98 -------- .../version-3.9.0/migration-guide/index.mdx | 98 -------- .../version-1.1.0-sidebars.json | 8 - .../version-1.10.0-sidebars.json | 8 - .../version-1.11.0-sidebars.json | 8 - .../version-1.12.0-sidebars.json | 8 - .../version-1.2.0-sidebars.json | 8 - .../version-1.3.0-sidebars.json | 8 - .../version-1.4.0-sidebars.json | 8 - .../version-1.5.0-sidebars.json | 8 - .../version-1.6.0-sidebars.json | 8 - .../version-1.7.0-sidebars.json | 8 - .../version-1.8.0-sidebars.json | 8 - .../version-1.9.0-sidebars.json | 8 - .../version-2.0.0-sidebars.json | 8 - .../version-2.1.0-sidebars.json | 8 - .../version-2.2.0-sidebars.json | 8 - .../version-2.3.0-sidebars.json | 8 - .../version-2.4.0-sidebars.json | 8 - .../version-3.0.0-sidebars.json | 8 - .../version-3.1.0-sidebars.json | 8 - ...bars.json => version-3.10.0-sidebars.json} | 0 .../version-3.2.0-sidebars.json | 8 - .../version-3.3.0-sidebars.json | 8 - .../version-3.3.2-sidebars.json | 8 - .../version-3.4.0-sidebars.json | 8 - .../version-3.5.0-sidebars.json | 8 - .../version-3.6.0-sidebars.json | 8 - .../version-3.7.0-sidebars.json | 8 - .../version-3.8.0-sidebars.json | 8 - .../version-3.9.0-sidebars.json | 8 - documentation/versions.json | 32 +-- package.json | 2 +- types/device.d.ts | 54 +++++ 17550 files changed, 500 insertions(+), 635393 deletions(-) create mode 100644 documentation/docs/fastly:device/Device/lookup.mdx create mode 100644 documentation/docs/fastly:device/Device/prototype/brand.mdx create mode 100644 documentation/docs/fastly:device/Device/prototype/hardwareType.mdx create mode 100644 documentation/docs/fastly:device/Device/prototype/isDesktop.mdx create mode 100644 documentation/docs/fastly:device/Device/prototype/isGameConsole.mdx create mode 100644 documentation/docs/fastly:device/Device/prototype/isMediaPlayer.mdx create mode 100644 documentation/docs/fastly:device/Device/prototype/isMobile.mdx create mode 100644 documentation/docs/fastly:device/Device/prototype/isSmartTV.mdx create mode 100644 documentation/docs/fastly:device/Device/prototype/isTablet.mdx create mode 100644 documentation/docs/fastly:device/Device/prototype/isTouchscreen.mdx create mode 100644 documentation/docs/fastly:device/Device/prototype/model.mdx create mode 100644 documentation/docs/fastly:device/Device/prototype/name.mdx create mode 100644 documentation/docs/fastly:device/Device/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:object-store/ObjectStore/ObjectStore.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:object-store/ObjectStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/fastly:object-store/ObjectStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.0.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/fastly:object-store/ObjectStore/ObjectStore.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/fastly:object-store/ObjectStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/fastly:object-store/ObjectStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-1.1.0/index.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:object-store/ObjectStore/ObjectStore.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:object-store/ObjectStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/fastly:object-store/ObjectStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-1.10.0/index.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:object-store/ObjectStore/ObjectStore.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:object-store/ObjectStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:object-store/ObjectStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-1.11.0/index.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:object-store/ObjectStore/ObjectStore.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:object-store/ObjectStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:object-store/ObjectStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-1.12.0/index.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:object-store/ObjectStore/ObjectStore.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:object-store/ObjectStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/fastly:object-store/ObjectStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-1.2.0/index.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:object-store/ObjectStore/ObjectStore.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:object-store/ObjectStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/fastly:object-store/ObjectStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-1.3.0/index.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:object-store/ObjectStore/ObjectStore.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:object-store/ObjectStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:object-store/ObjectStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-1.4.0/index.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:object-store/ObjectStore/ObjectStore.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:object-store/ObjectStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:object-store/ObjectStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-1.5.0/index.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:object-store/ObjectStore/ObjectStore.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:object-store/ObjectStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:object-store/ObjectStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-1.6.0/index.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:object-store/ObjectStore/ObjectStore.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:object-store/ObjectStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:object-store/ObjectStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-1.7.0/index.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:object-store/ObjectStore/ObjectStore.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:object-store/ObjectStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:object-store/ObjectStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-1.8.0/index.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:object-store/ObjectStore/ObjectStore.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:object-store/ObjectStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:object-store/ObjectStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-1.9.0/index.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/index.mdx delete mode 100644 documentation/versioned_docs/version-2.0.0/migration-guide/index.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/set.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/index.mdx delete mode 100644 documentation/versioned_docs/version-2.1.0/migration-guide/index.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/getOrSet.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/set.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/index.mdx delete mode 100644 documentation/versioned_docs/version-2.2.0/migration-guide/index.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/getOrSet.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/set.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/index.mdx delete mode 100644 documentation/versioned_docs/version-2.3.0/migration-guide/index.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/getOrSet.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/set.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/performance/now.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/performance/timeOrigin.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/index.mdx delete mode 100644 documentation/versioned_docs/version-2.4.0/migration-guide/index.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/getOrSet.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/performance/now.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/performance/timeOrigin.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-3.0.0/index.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/getOrSet.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/purge.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DOMException/DOMException.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DOMException/code.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DOMException/message.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DOMException/name.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/HmacImportParams/HmacImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/performance/now.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/performance/timeOrigin.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/index.mdx delete mode 100644 documentation/versioned_docs/version-3.1.0/migration-guide/index.mdx rename documentation/versioned_docs/{version-3.7.0 => version-3.10.0}/fastly:backend/Backend/Backend.mdx (100%) rename documentation/versioned_docs/{version-3.7.0 => version-3.10.0}/fastly:backend/Backend/exists.mdx (100%) rename documentation/versioned_docs/{version-3.7.0 => version-3.10.0}/fastly:backend/Backend/fromName.mdx (100%) rename documentation/versioned_docs/{version-3.7.0 => version-3.10.0}/fastly:backend/Backend/health.mdx (100%) rename documentation/versioned_docs/{version-3.7.0 => version-3.10.0}/fastly:backend/Backend/prototype/toName.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/fastly:backend/Backend/prototype/toString.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/fastly:cache-override/CacheOverride/CacheOverride.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CacheEntry/age.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CacheEntry/body.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CacheEntry/close.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CacheEntry/hits.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CacheEntry/length.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CacheEntry/maxAge.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CacheEntry/staleWhileRevalidate.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CacheEntry/state.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CacheEntry/userMetadata.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CacheState/found.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CacheState/mustInsertOrUpdate.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CacheState/stale.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CacheState/usable.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CoreCache/insert.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CoreCache/lookup.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/CoreCache/transactionLookup.mdx (98%) rename documentation/versioned_docs/{version-2.2.0 => version-3.10.0}/fastly:cache/SimpleCache/SimpleCache.mdx (100%) rename documentation/versioned_docs/{version-3.4.0 => version-3.10.0}/fastly:cache/SimpleCache/get.mdx (100%) rename documentation/versioned_docs/{version-3.8.0 => version-3.10.0}/fastly:cache/SimpleCache/getOrSet.mdx (100%) rename documentation/versioned_docs/{version-3.0.0 => version-3.10.0}/fastly:cache/SimpleCache/purge.mdx (100%) rename documentation/versioned_docs/{version-2.1.0 => version-3.10.0}/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx (100%) rename documentation/versioned_docs/{version-2.1.0 => version-3.10.0}/fastly:cache/SimpleCacheEntry/body.mdx (100%) rename documentation/versioned_docs/{version-2.1.0 => version-3.10.0}/fastly:cache/SimpleCacheEntry/bodyUsed.mdx (100%) rename documentation/versioned_docs/{version-2.1.0 => version-3.10.0}/fastly:cache/SimpleCacheEntry/json.mdx (100%) rename documentation/versioned_docs/{version-2.1.0 => version-3.10.0}/fastly:cache/SimpleCacheEntry/text.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/TransactionCacheEntry/age.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/TransactionCacheEntry/body.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/TransactionCacheEntry/cancel.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/TransactionCacheEntry/close.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/TransactionCacheEntry/hits.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/TransactionCacheEntry/insert.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/TransactionCacheEntry/insertAndStreamBack.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/TransactionCacheEntry/length.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/TransactionCacheEntry/maxAge.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/TransactionCacheEntry/staleWhileRevalidate.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/TransactionCacheEntry/state.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/TransactionCacheEntry/update.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:cache/TransactionCacheEntry/userMetadata.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/fastly:config-store/ConfigStore/ConfigStore.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/fastly:config-store/ConfigStore/prototype/get.mdx (100%) create mode 100644 documentation/versioned_docs/version-3.10.0/fastly:device/Device/lookup.mdx create mode 100644 documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/brand.mdx create mode 100644 documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/hardwareType.mdx create mode 100644 documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isDesktop.mdx create mode 100644 documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isGameConsole.mdx create mode 100644 documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isMediaPlayer.mdx create mode 100644 documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isMobile.mdx create mode 100644 documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isSmartTV.mdx create mode 100644 documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isTablet.mdx create mode 100644 documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isTouchscreen.mdx create mode 100644 documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/model.mdx create mode 100644 documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/name.mdx create mode 100644 documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/toJSON.mdx rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/fastly:dictionary/Dictionary/Dictionary.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/fastly:dictionary/Dictionary/prototype/get.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:edge-rate-limiter/EdgeRateLimiter/EdgeRateLimiter.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:edge-rate-limiter/EdgeRateLimiter/prototype/checkRate.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:edge-rate-limiter/PenaltyBox/PenaltyBox.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:edge-rate-limiter/PenaltyBox/prototype/add.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:edge-rate-limiter/PenaltyBox/prototype/has.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:edge-rate-limiter/RateCounter/RateCounter.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:edge-rate-limiter/RateCounter/prototype/increment.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:edge-rate-limiter/RateCounter/prototype/lookupCount.mdx (100%) rename documentation/versioned_docs/{version-3.9.0 => version-3.10.0}/fastly:edge-rate-limiter/RateCounter/prototype/lookupRate.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/fastly:env/env.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/fastly:experimental/allowDynamicBackends.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/fastly:experimental/includeBytes.mdx (100%) rename documentation/versioned_docs/{version-1.12.0 => version-3.10.0}/fastly:fanout/createFanoutHandoff.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/fastly:geolocation/getGeolocationForIpAddress.mdx (100%) rename documentation/versioned_docs/{version-3.6.0 => version-3.10.0}/fastly:kv-store/KVStore/KVStore.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/fastly:kv-store/KVStore/prototype/get.mdx (100%) rename documentation/versioned_docs/{version-3.8.0 => version-3.10.0}/fastly:kv-store/KVStore/prototype/put.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/fastly:kv-store/KVStoreEntry/prototype/body.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/fastly:kv-store/KVStoreEntry/prototype/json.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/fastly:kv-store/KVStoreEntry/prototype/text.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/fastly:logger/Logger/Logger.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/fastly:logger/Logger/prototype/log.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/fastly:secret-store/SecretStore/SecretStore.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/fastly:secret-store/SecretStore/prototype/get.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/AggregrateError/AggregrateError.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/@@species.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/Array.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/from.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/isArray.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/of.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/@@iterator.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/@@unscopables.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/at.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/concat.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/copyWithin.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/entries.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/every.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/fill.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/filter.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/find.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/findIndex.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/flat.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/flatMap.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/forEach.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/includes.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/indexOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/join.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/keys.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/lastIndexOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/length.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/map.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/pop.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/push.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/reduce.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/reduceRight.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/reverse.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/shift.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/slice.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/some.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/sort.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/splice.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/Array/prototype/toLocaleString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/toString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/unshift.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Array/prototype/values.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ArrayBuffer/@@species.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ArrayBuffer/ArrayBuffer.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ArrayBuffer/isView.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ArrayBuffer/prototype/byteLength.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ArrayBuffer/prototype/slice.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/BigInt/BigInt.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/globals/BigInt/asIntN.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/globals/BigInt/asUintN.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/BigInt/prototype/toLocaleString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/BigInt/prototype/toString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/BigInt/prototype/valueOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/BigInt64Array/BigInt64Array.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/BigUint64Array/BigUint64Array.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Boolean/Boolean.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Boolean/prototype/toString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Boolean/prototype/valueOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ByteLengthQueuingStrategy/prototype/size.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/CompressionStream/CompressionStream.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/CompressionStream/prototype/readable.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/CompressionStream/prototype/writable.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/CryptoKey/CryptoKey.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/CryptoKey/prototype/algorithm.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/CryptoKey/prototype/extractable.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/CryptoKey/prototype/type.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/CryptoKey/prototype/usages.mdx (100%) rename documentation/versioned_docs/{version-3.0.0 => version-3.10.0}/globals/DOMException/DOMException.mdx (100%) rename documentation/versioned_docs/{version-3.0.0 => version-3.10.0}/globals/DOMException/code.mdx (100%) rename documentation/versioned_docs/{version-3.0.0 => version-3.10.0}/globals/DOMException/message.mdx (100%) rename documentation/versioned_docs/{version-3.0.0 => version-3.10.0}/globals/DOMException/name.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/DataView.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/buffer.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/byteLength.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/byteOffset.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/getBigInt64.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/getBigUint64.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/getFloat32.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/getFloat64.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/getInt16.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/getInt32.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/getInt8.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/getUint16.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/getUint32.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/getUint8.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/setBigInt64.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/setBigUint64.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/setFloat32.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/setFloat64.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/setInt16.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/setInt32.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/setInt8.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/setUint16.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/setUint32.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DataView/prototype/setUint8.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/Date.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/UTC.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/now.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/parse.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/@@toPrimitive.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getDate.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getDay.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getFullYear.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getHours.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getMilliseconds.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getMinutes.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getMonth.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getSeconds.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getTime.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getTimezoneOffset.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getUTCDate.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getUTCDay.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getUTCFullYear.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getUTCHours.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getUTCMilliseconds.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getUTCMinutes.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getUTCMonth.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getUTCSeconds.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/getYear.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setDate.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setFullYear.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setHours.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setMilliseconds.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setMinutes.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setMonth.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setSeconds.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setTime.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setUTCDate.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setUTCFullYear.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setUTCHours.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setUTCMilliseconds.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setUTCMinutes.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setUTCMonth.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setUTCSeconds.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/setYear.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/toDateString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/toISOString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/toJSON.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/toLocaleDateString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/toLocaleString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/toLocaleTimeString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/toString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/toTimeString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/toUTCString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Date/prototype/valueOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DecompressionStream/DecompressionStream.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DecompressionStream/prototype/readable.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/DecompressionStream/prototype/writable.mdx (100%) rename documentation/versioned_docs/{version-3.7.0 => version-3.10.0}/globals/EcKeyImportParams/EcKeyImportParams.mdx (100%) rename documentation/versioned_docs/{version-3.4.0 => version-3.10.0}/globals/EcdsaParams/EcdsaParams.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Error/Error.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Error/prototype/cause.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Error/prototype/message.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Error/prototype/name.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Error/prototype/toString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/EvalError/EvalError.mdx (100%) rename documentation/versioned_docs/{version-3.3.0 => version-3.10.0}/globals/FetchEvent/FetchEvent.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/FetchEvent/prototype/respondWith.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/FetchEvent/prototype/waitUntil.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/FinalizationRegistry/FinalizationRegistry.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/FinalizationRegistry/prototype/register.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/FinalizationRegistry/prototype/unregister.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Float32Array/Float32Array.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Float64Array/Float64Array.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Function/Function.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Function/prototype/apply.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Function/prototype/bind.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Function/prototype/call.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Function/prototype/index.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Function/prototype/length.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Function/prototype/name.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Function/prototype/toString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Headers/Headers.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Headers/prototype/append.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Headers/prototype/delete.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Headers/prototype/entries.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Headers/prototype/forEach.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Headers/prototype/get.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Headers/prototype/has.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Headers/prototype/keys.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Headers/prototype/set.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Headers/prototype/values.mdx (100%) rename documentation/versioned_docs/{version-3.0.0 => version-3.10.0}/globals/HmacImportParams/HmacImportParams.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Infinity.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Int16Array/Int16Array.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Int32Array/Int32Array.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Int8Array/Int8Array.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/JSON/parse.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/JSON/stringify.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Map/@@species.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Map/Map.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Map/prototype/@@iterator.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Map/prototype/clear.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Map/prototype/delete.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Map/prototype/entries.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Map/prototype/forEach.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Map/prototype/get.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Map/prototype/has.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Map/prototype/keys.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Map/prototype/set.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Map/prototype/size.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Map/prototype/values.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/E.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/LN10.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/LN2.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/LOG10e.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/LOG2e.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/PI.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/SQRT1_2.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/SQRT2.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/abs.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/acos.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/acosh.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/asin.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/asinh.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/atan.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/atan2.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/atanh.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/cbrt.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/ceil.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/clz32.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/cos.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/cosh.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/exp.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/expm1.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/floor.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/fround.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/hypot.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/globals/Math/imul.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/log.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/log10.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/log1p.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/log2.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/max.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/min.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/pow.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/random.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/round.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/sign.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/sin.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/sinh.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/sqrt.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/tan.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/tanh.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Math/trunc.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/NaN.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/MAX_SAFE_INTEGER.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/MAX_VALUE.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/MIN_SAFE_INTEGER.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/MIN_VALUE.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/NEGATIVE_INFINITY.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/NaN.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/Number.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/POSITIVE_INFINITY.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/epsilon.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/isFinite.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/isInteger.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/isNaN.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/isSafeInteger.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/parseFloat.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/parseInt.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/prototype/toExponential.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/prototype/toFixed.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/prototype/toLocaleString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/prototype/toPrecision.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/prototype/toString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Number/prototype/valueOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/Object.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/assign.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/create.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/defineProperties.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/defineProperty.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/entries.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/freeze.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/fromEntries.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/getOwnPropertyDescriptor.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/getOwnPropertyDescriptors.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/getOwnPropertyNames.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/getOwnPropertySymbols.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/getPrototypeOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/hasOwn.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/is.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/isExtensible.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/isFrozen.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/isSealed.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/keys.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/preventExtensions.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/prototype/constructor.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/prototype/hasOwnProperty.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/prototype/isPrototypeOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/prototype/propertyIsEnumerable.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/prototype/toLocaleString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/prototype/toString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/prototype/valueOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/seal.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/setPrototypeOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Object/values.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Promise/@@species.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Promise/Promise.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Promise/all.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Promise/allSettled.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Promise/any.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Promise/prototype/catch.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Promise/prototype/finally.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Promise/prototype/then.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Promise/race.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Promise/reject.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Promise/resolve.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/Proxy.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/proxy/apply.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/proxy/construct.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/proxy/defineProperty.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/proxy/deleteProperty.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/proxy/get.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/proxy/getPrototypeOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/proxy/has.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/proxy/isExtensible.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/proxy/ownKeys.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/proxy/preventExtensions.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/proxy/set.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Proxy/proxy/setPrototypeOf.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/globals/Proxy/revocable.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/RangeError/RangeError.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableByteStreamController/prototype/byobRequest.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableByteStreamController/prototype/close.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableByteStreamController/prototype/desiredSize.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableByteStreamController/prototype/enqueue.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableByteStreamController/prototype/error.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStream/ReadableStream.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStream/prototype/cancel.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableStream/prototype/getReader.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStream/prototype/locked.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStream/prototype/pipeThrough.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStream/prototype/pipeTo.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStream/prototype/tee.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableStreamBYOBReader/prototype/cancel.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableStreamBYOBReader/prototype/closed.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableStreamBYOBReader/prototype/read.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableStreamBYOBRequest/prototype/respond.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/ReadableStreamBYOBRequest/prototype/view.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStreamDefaultController/prototype/close.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStreamDefaultController/prototype/enqueue.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStreamDefaultController/prototype/error.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStreamDefaultReader/prototype/cancel.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStreamDefaultReader/prototype/closed.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStreamDefaultReader/prototype/read.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/ReferenceError/ReferenceError.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Reflect/apply.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Reflect/construct.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Reflect/defineProperty.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Reflect/deleteProperty.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Reflect/get.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Reflect/getOwnPropertyDescriptor.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Reflect/getPrototypeOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Reflect/has.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Reflect/isExtensible.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Reflect/ownKeys.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Reflect/preventExtensions.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Reflect/set.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Reflect/setPrototypeOf.mdx (100%) rename documentation/versioned_docs/{version-3.8.0 => version-3.10.0}/globals/Request/Request.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Request/prototype/arrayBuffer.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Request/prototype/body.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Request/prototype/bodyUsed.mdx (100%) rename documentation/versioned_docs/{version-3.3.2 => version-3.10.0}/globals/Request/prototype/clone.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Request/prototype/headers.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Request/prototype/json.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Request/prototype/method.mdx (100%) rename documentation/versioned_docs/{version-3.8.0 => version-3.10.0}/globals/Request/prototype/setManualFramingHeaders.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Request/prototype/text.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Request/prototype/url.mdx (100%) rename documentation/versioned_docs/{version-3.8.0 => version-3.10.0}/globals/Response/Response.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Response/prototype/arrayBuffer.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Response/prototype/body.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Response/prototype/bodyUsed.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Response/prototype/headers.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Response/prototype/json.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Response/prototype/ok.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Response/prototype/status.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Response/prototype/statusText.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Response/prototype/text.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Response/prototype/url.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/Response/redirect.mdx (100%) rename documentation/versioned_docs/{version-3.8.0 => version-3.10.0}/globals/Response/setManualFramingHeaders.mdx (100%) rename documentation/versioned_docs/{version-3.0.0 => version-3.10.0}/globals/RsaHashedImportParams/RsaHashedImportParams.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Set/@@species.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Set/Set.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Set/prototype/@@iterator.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Set/prototype/add.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Set/prototype/clear.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Set/prototype/delete.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Set/prototype/entries.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Set/prototype/forEach.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Set/prototype/has.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Set/prototype/keys.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Set/prototype/size.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Set/prototype/values.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/String.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/fromCharCode.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/fromCodePoint.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/@@iterator.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/at.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/charAt.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/charCodeAt.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/codePointAt.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/concat.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/endsWith.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/includes.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/indexOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/lastIndexOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/length.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/localeCompare.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/match.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/matchAll.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/padEnd.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/padStart.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/String/prototype/repeat.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/replace.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/replaceAll.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/search.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/slice.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/split.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/startsWith.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/substr.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/substring.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/toLocaleLowerCase.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/toLocaleUpperCase.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/toLowerCase.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/toString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/toUpperCase.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/trim.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/globals/String/prototype/trimEnd.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/trimStart.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/prototype/valueOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/String/raw.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/SubtleCrypto/SubtleCrypto.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/SubtleCrypto/prototype/digest.mdx (100%) rename documentation/versioned_docs/{version-3.4.0 => version-3.10.0}/globals/SubtleCrypto/prototype/importKey.mdx (100%) rename documentation/versioned_docs/{version-3.0.0 => version-3.10.0}/globals/SubtleCrypto/prototype/sign.mdx (100%) rename documentation/versioned_docs/{version-3.0.0 => version-3.10.0}/globals/SubtleCrypto/prototype/verify.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/Symbol.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/asyncIterator.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/for.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/hasInstance.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/isConcatSpreadable.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/iterator.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/keyFor.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/match.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/matchAll.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/prototype/@@toPrimitive.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/prototype/description.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/prototype/toString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/prototype/valueOf.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/replace.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/search.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/species.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/split.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/globals/Symbol/toPrimitive.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/toStringTag.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Symbol/unscopables.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/SyntaxError/SyntaxError.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TextDecoder/TextDecoder.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TextDecoder/prototype/decode.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TextDecoder/prototype/encoding.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TextDecoder/prototype/fatal.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TextDecoder/prototype/ignoreBOM.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TextEncoder/TextEncoder.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TextEncoder/prototype/encode.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TextEncoder/prototype/encoding.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TransformStream/TransformStream.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TransformStream/prototype/readable.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TransformStream/prototype/writable.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TransformStreamDefaultController/prototype/desiredSize.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TransformStreamDefaultController/prototype/enqueue.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TransformStreamDefaultController/prototype/error.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TransformStreamDefaultController/prototype/terminate.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/TypeError/TypeError.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URIError/URIError.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/URL.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/hash.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/host.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/hostname.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/href.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/origin.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/password.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/pathname.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/port.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/protocol.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/search.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/searchParams.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/toJSON.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/toString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URL/prototype/username.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URLSearchParams/URLSearchParams.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URLSearchParams/prototype/append.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URLSearchParams/prototype/delete.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URLSearchParams/prototype/entries.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URLSearchParams/prototype/forEach.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URLSearchParams/prototype/get.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URLSearchParams/prototype/has.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URLSearchParams/prototype/keys.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URLSearchParams/prototype/set.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URLSearchParams/prototype/sort.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URLSearchParams/prototype/toString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/URLSearchParams/prototype/values.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Uint16Array/Uint16Array.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Uint32Array/Uint32Array.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Uint8Array/Uint8Array.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/Uint8ClampedArray/Uint8ClampedArray.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WeakMap/WeakMap.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WeakMap/prototype/delete.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WeakMap/prototype/get.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WeakMap/prototype/has.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WeakMap/prototype/set.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WeakRef/WeakRef.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WeakRef/prototype/deref.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WeakSet/WeakSet.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WeakSet/prototype/add.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WeakSet/prototype/delete.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WeakSet/prototype/has.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WorkerLocation/WorkerLocation.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WorkerLocation/hash.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WorkerLocation/host.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WorkerLocation/hostname.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WorkerLocation/href.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WorkerLocation/origin.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WorkerLocation/pathname.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WorkerLocation/port.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WorkerLocation/protocol.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WorkerLocation/search.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WorkerLocation/toString.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WritableStream/WritableStream.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WritableStream/prototype/abort.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WritableStream/prototype/getWriter.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WritableStream/prototype/locked.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WritableStreamDefaultController/error.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WritableStreamDefaultWriter/prototype/abort.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WritableStreamDefaultWriter/prototype/close.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WritableStreamDefaultWriter/prototype/closed.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WritableStreamDefaultWriter/prototype/ready.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/WritableStreamDefaultWriter/prototype/write.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/atob.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/btoa.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/clearInterval.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/clearTimeout.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/globals/console/assert.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/globals/console/clear.mdx (100%) rename documentation/versioned_docs/{version-3.0.0 => version-3.10.0}/globals/console/count.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/globals/console/countReset.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/console/debug.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/globals/console/dir.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/globals/console/dirxml.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/console/error.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/globals/console/group.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/globals/console/groupCollapsed.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/globals/console/groupEnd.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/console/info.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/console/log.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/globals/console/time.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/globals/console/timeEnd.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/globals/console/timeLog.mdx (100%) rename documentation/versioned_docs/{version-2.0.0 => version-3.10.0}/globals/console/trace.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/console/warn.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/crypto/getRandomValues.mdx (100%) rename documentation/versioned_docs/{version-1.1.0 => version-3.10.0}/globals/crypto/randomUUID.mdx (100%) rename documentation/versioned_docs/{version-1.10.0 => version-3.10.0}/globals/crypto/subtle.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/decodeURI.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/decodeURIComponent.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/encodeURI.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/encodeURIComponent.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/escape.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/eval.mdx (100%) rename documentation/versioned_docs/{version-3.2.0 => version-3.10.0}/globals/fetch.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/globalThis.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/isFinite.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/isNaN.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/location.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/parseFloat.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/parseInt.mdx (100%) rename documentation/versioned_docs/{version-2.3.0 => version-3.10.0}/globals/performance/now.mdx (100%) rename documentation/versioned_docs/{version-2.3.0 => version-3.10.0}/globals/performance/timeOrigin.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/setInterval.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/setTimeout.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/structuredClone.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/undefined.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/globals/unescape.mdx (100%) rename documentation/versioned_docs/{version-1.0.0 => version-3.10.0}/index.mdx (100%) rename documentation/versioned_docs/{version-3.0.0 => version-3.10.0}/migration-guide/index.mdx (100%) delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/getOrSet.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/purge.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DOMException/DOMException.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DOMException/code.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DOMException/message.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DOMException/name.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/HmacImportParams/HmacImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/performance/now.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/performance/timeOrigin.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/index.mdx delete mode 100644 documentation/versioned_docs/version-3.2.0/migration-guide/index.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/getOrSet.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/purge.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DOMException/DOMException.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DOMException/code.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DOMException/message.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DOMException/name.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/HmacImportParams/HmacImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/performance/now.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/performance/timeOrigin.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/index.mdx delete mode 100644 documentation/versioned_docs/version-3.3.0/migration-guide/index.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/getOrSet.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/purge.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DOMException/DOMException.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DOMException/code.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DOMException/message.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DOMException/name.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/HmacImportParams/HmacImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/performance/now.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/performance/timeOrigin.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/index.mdx delete mode 100644 documentation/versioned_docs/version-3.3.2/migration-guide/index.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/getOrSet.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/purge.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DOMException/DOMException.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DOMException/code.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DOMException/message.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DOMException/name.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/EcKeyImportParams/EcKeyImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/HmacImportParams/HmacImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Request/prototype/clone.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/performance/now.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/performance/timeOrigin.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/index.mdx delete mode 100644 documentation/versioned_docs/version-3.4.0/migration-guide/index.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/getOrSet.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/purge.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DOMException/DOMException.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DOMException/code.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DOMException/message.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DOMException/name.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/EcKeyImportParams/EcKeyImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/EcdsaParams/EcdsaParams.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/HmacImportParams/HmacImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Request/prototype/clone.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/performance/now.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/performance/timeOrigin.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/index.mdx delete mode 100644 documentation/versioned_docs/version-3.5.0/migration-guide/index.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/getOrSet.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/purge.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DOMException/DOMException.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DOMException/code.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DOMException/message.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DOMException/name.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/EcKeyImportParams/EcKeyImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/EcdsaParams/EcdsaParams.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/HmacImportParams/HmacImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Request/prototype/clone.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/performance/now.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/performance/timeOrigin.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/index.mdx delete mode 100644 documentation/versioned_docs/version-3.6.0/migration-guide/index.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/getOrSet.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/purge.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DOMException/DOMException.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DOMException/code.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DOMException/message.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DOMException/name.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/EcdsaParams/EcdsaParams.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/HmacImportParams/HmacImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Request/prototype/clone.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/performance/now.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/performance/timeOrigin.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/index.mdx delete mode 100644 documentation/versioned_docs/version-3.7.0/migration-guide/index.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/exists.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/fromName.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/health.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/prototype/toName.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/purge.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DOMException/DOMException.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DOMException/code.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DOMException/message.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DOMException/name.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/EcKeyImportParams/EcKeyImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/EcdsaParams/EcdsaParams.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/HmacImportParams/HmacImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Request/prototype/clone.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/performance/now.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/performance/timeOrigin.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/index.mdx delete mode 100644 documentation/versioned_docs/version-3.8.0/migration-guide/index.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/Backend.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/exists.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/fromName.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/health.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/prototype/toName.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:cache-override/CacheOverride/CacheOverride.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/SimpleCache.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/get.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/getOrSet.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/purge.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/body.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/json.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/text.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:config-store/ConfigStore/ConfigStore.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:config-store/ConfigStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:dictionary/Dictionary/Dictionary.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:dictionary/Dictionary/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:env/env.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:experimental/allowDynamicBackends.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:experimental/includeBytes.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:fanout/createFanoutHandoff.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:geolocation/getGeolocationForIpAddress.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStore/KVStore.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStore/prototype/put.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:logger/Logger/Logger.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:logger/Logger/prototype/log.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:secret-store/SecretStore/SecretStore.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:secret-store/SecretStore/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/AggregrateError/AggregrateError.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/Array.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/from.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/isArray.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/of.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/@@unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/copyWithin.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/every.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/fill.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/filter.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/find.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/findIndex.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/flat.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/flatMap.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/join.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/map.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/pop.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/push.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/reduce.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/reduceRight.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/reverse.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/shift.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/some.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/splice.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/unshift.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Array/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/ArrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/isView.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/BigInt/BigInt.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/BigInt/asIntN.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/BigInt/asUintN.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/BigInt/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/BigInt/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/BigInt/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/BigInt64Array/BigInt64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/BigUint64Array/BigUint64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Boolean/Boolean.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Boolean/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Boolean/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/CompressionStream/CompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/CompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/CompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/CryptoKey/CryptoKey.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/algorithm.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/extractable.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/type.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/usages.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DOMException/DOMException.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DOMException/code.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DOMException/message.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DOMException/name.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/DataView.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/buffer.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/byteLength.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/byteOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setBigInt64.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setBigUint64.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setFloat32.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setFloat64.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setInt16.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setInt32.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setInt8.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setUint16.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setUint32.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setUint8.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/Date.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/UTC.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/now.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getDate.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getDay.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getHours.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getTime.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getTimezoneOffset.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCDay.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getYear.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setDate.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setHours.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setTime.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCDate.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCFullYear.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCHours.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCMilliseconds.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCMinutes.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCMonth.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCSeconds.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setYear.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toISOString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toLocaleDateString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toLocaleTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toTimeString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toUTCString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Date/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DecompressionStream/DecompressionStream.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DecompressionStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/DecompressionStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/EcKeyImportParams/EcKeyImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/EcdsaParams/EcdsaParams.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Error/Error.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Error/prototype/cause.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Error/prototype/message.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Error/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Error/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/EvalError/EvalError.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/FetchEvent/FetchEvent.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/FetchEvent/prototype/respondWith.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/FetchEvent/prototype/waitUntil.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/FinalizationRegistry/FinalizationRegistry.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/FinalizationRegistry/prototype/register.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/FinalizationRegistry/prototype/unregister.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Float32Array/Float32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Float64Array/Float64Array.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Function/Function.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Function/prototype/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Function/prototype/bind.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Function/prototype/call.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Function/prototype/index.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Function/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Function/prototype/name.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Function/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Headers/Headers.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/HmacImportParams/HmacImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Infinity.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Int16Array/Int16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Int32Array/Int32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Int8Array/Int8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/JSON/parse.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/JSON/stringify.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Map/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Map/Map.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Map/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Map/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Map/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Map/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Map/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Map/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Map/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Map/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Map/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Map/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Map/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/E.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/LN10.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/LN2.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/LOG10e.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/LOG2e.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/PI.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/SQRT1_2.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/SQRT2.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/abs.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/acos.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/acosh.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/asin.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/asinh.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/atan.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/atan2.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/atanh.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/cbrt.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/ceil.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/clz32.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/cos.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/cosh.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/exp.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/expm1.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/floor.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/fround.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/hypot.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/imul.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/log.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/log10.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/log1p.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/log2.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/max.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/min.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/pow.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/random.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/round.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/sin.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/sinh.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/sqrt.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/tan.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/tanh.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Math/trunc.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/MAX_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/MAX_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/MIN_SAFE_INTEGER.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/MIN_VALUE.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/NEGATIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/NaN.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/Number.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/POSITIVE_INFINITY.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/epsilon.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/isInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/isSafeInteger.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toExponential.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toFixed.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toPrecision.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Number/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/Object.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/assign.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/create.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/defineProperties.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/freeze.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/fromEntries.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertyDescriptors.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertyNames.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertySymbols.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/hasOwn.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/is.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/isFrozen.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/isSealed.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/prototype/constructor.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/prototype/hasOwnProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/prototype/isPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/prototype/propertyIsEnumerable.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/prototype/toLocaleString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/seal.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Object/values.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Promise/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Promise/Promise.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Promise/all.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Promise/allSettled.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Promise/any.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Promise/prototype/catch.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Promise/prototype/finally.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Promise/prototype/then.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Promise/race.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Promise/reject.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Promise/resolve.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/Proxy.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/get.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/has.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/set.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Proxy/revocable.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/RangeError/RangeError.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStream/ReadableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/getReader.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/pipeThrough.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/pipeTo.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/tee.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/read.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/ReferenceError/ReferenceError.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Reflect/apply.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Reflect/construct.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Reflect/defineProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Reflect/deleteProperty.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Reflect/get.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Reflect/getOwnPropertyDescriptor.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Reflect/getPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Reflect/has.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Reflect/isExtensible.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Reflect/ownKeys.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Reflect/preventExtensions.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Reflect/set.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Reflect/setPrototypeOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Request/Request.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Request/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Request/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Request/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Request/prototype/clone.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Request/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Request/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Request/prototype/method.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Request/prototype/setManualFramingHeaders.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Request/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Request/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Response/Response.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Response/prototype/arrayBuffer.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Response/prototype/body.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Response/prototype/bodyUsed.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Response/prototype/headers.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Response/prototype/json.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Response/prototype/ok.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Response/prototype/status.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Response/prototype/statusText.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Response/prototype/text.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Response/prototype/url.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Response/redirect.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Response/setManualFramingHeaders.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Set/@@species.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Set/Set.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Set/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Set/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Set/prototype/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Set/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Set/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Set/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Set/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Set/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Set/prototype/size.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Set/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/String.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/fromCharCode.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/fromCodePoint.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/@@iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/at.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/charAt.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/charCodeAt.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/codePointAt.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/concat.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/endsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/includes.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/indexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/lastIndexOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/length.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/localeCompare.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/match.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/padEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/padStart.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/repeat.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/replaceAll.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/slice.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/split.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/startsWith.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/substr.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/substring.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/toLocaleLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/toLocaleUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/toLowerCase.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/toUpperCase.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/trim.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/trimEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/trimStart.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/String/raw.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/SubtleCrypto.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/digest.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/importKey.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/sign.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/verify.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/Symbol.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/asyncIterator.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/for.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/hasInstance.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/isConcatSpreadable.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/iterator.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/keyFor.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/match.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/matchAll.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/@@toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/description.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/valueOf.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/replace.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/search.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/species.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/split.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/toPrimitive.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/toStringTag.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Symbol/unscopables.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/SyntaxError/SyntaxError.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TextDecoder/TextDecoder.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/decode.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/fatal.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/ignoreBOM.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TextEncoder/TextEncoder.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TextEncoder/prototype/encode.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TextEncoder/prototype/encoding.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TransformStream/TransformStream.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TransformStream/prototype/readable.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TransformStream/prototype/writable.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/error.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/terminate.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/TypeError/TypeError.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URIError/URIError.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/URL.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/host.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/href.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/password.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/port.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/search.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/searchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/toJSON.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URL/prototype/username.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/URLSearchParams.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/append.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/entries.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/forEach.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/keys.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/sort.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/values.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Uint16Array/Uint16Array.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Uint32Array/Uint32Array.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Uint8Array/Uint8Array.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WeakMap/WeakMap.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/get.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/set.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WeakRef/WeakRef.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WeakRef/prototype/deref.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WeakSet/WeakSet.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WeakSet/prototype/add.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WeakSet/prototype/delete.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WeakSet/prototype/has.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/WorkerLocation.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/hash.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/host.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/hostname.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/href.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/origin.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/pathname.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/port.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/protocol.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/search.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/toString.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WritableStream/WritableStream.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WritableStream/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WritableStream/prototype/getWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WritableStream/prototype/locked.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultController/error.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/close.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/write.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/atob.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/btoa.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/clearInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/clearTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/assert.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/clear.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/count.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/countReset.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/debug.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/dir.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/dirxml.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/error.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/group.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/groupCollapsed.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/groupEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/info.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/log.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/time.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/timeEnd.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/timeLog.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/trace.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/console/warn.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/crypto/getRandomValues.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/crypto/randomUUID.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/crypto/subtle.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/decodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/decodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/encodeURI.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/encodeURIComponent.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/escape.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/eval.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/fetch.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/globalThis.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/isFinite.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/isNaN.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/location.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/parseFloat.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/parseInt.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/performance/now.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/performance/timeOrigin.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/setInterval.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/setTimeout.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/structuredClone.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/undefined.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/globals/unescape.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/index.mdx delete mode 100644 documentation/versioned_docs/version-3.9.0/migration-guide/index.mdx delete mode 100644 documentation/versioned_sidebars/version-1.1.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-1.10.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-1.11.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-1.12.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-1.2.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-1.3.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-1.4.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-1.5.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-1.6.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-1.7.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-1.8.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-1.9.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-2.0.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-2.1.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-2.2.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-2.3.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-2.4.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-3.0.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-3.1.0-sidebars.json rename documentation/versioned_sidebars/{version-1.0.0-sidebars.json => version-3.10.0-sidebars.json} (100%) delete mode 100644 documentation/versioned_sidebars/version-3.2.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-3.3.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-3.3.2-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-3.4.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-3.5.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-3.6.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-3.7.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-3.8.0-sidebars.json delete mode 100644 documentation/versioned_sidebars/version-3.9.0-sidebars.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 89d7712c8d..d01453a849 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ # Changelog +## 3.10.0 (2024-03-09) + + +### Added + +* add fastly:device module which allows applications to detect a device based on a user-agent ([#738](https://github.com/fastly/js-compute-runtime/issues/738)) ([5274fd5](https://github.com/fastly/js-compute-runtime/commit/5274fd5280d80b276e6f13d4acbdefc435af6c57)) + + +### Fixed + +* correct title for the CoreCache.transactionLookup documentation page ([9892d90](https://github.com/fastly/js-compute-runtime/commit/9892d9074d9a1bd25b9b5db28c12a940f2aac028)) + ## 3.9.1 (2024-03-04) diff --git a/documentation/docs/fastly:device/Device/lookup.mdx b/documentation/docs/fastly:device/Device/lookup.mdx new file mode 100644 index 0000000000..71db040fc9 --- /dev/null +++ b/documentation/docs/fastly:device/Device/lookup.mdx @@ -0,0 +1,22 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- + +# Device.lookup() + +Look up the data associated with a particular User-Agent string. + + +## Syntax + +```js +lookup(userAgent) +``` + +### Return value + +If there is data associated with the User-Agent, a `Device` instance is returned. +Otherwise, `null` is returned. diff --git a/documentation/docs/fastly:device/Device/prototype/brand.mdx b/documentation/docs/fastly:device/Device/prototype/brand.mdx new file mode 100644 index 0000000000..0212b64fff --- /dev/null +++ b/documentation/docs/fastly:device/Device/prototype/brand.mdx @@ -0,0 +1,16 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.brand + +The read-only **`brand`** property of the `Device` interface is +either a string stating the brand of the device, which can be different from the manufacturer of that device. +If no brand is known, the value will be `null`. + + +## Value + +Either a string value if a brand is known, otherwise `null`. diff --git a/documentation/docs/fastly:device/Device/prototype/hardwareType.mdx b/documentation/docs/fastly:device/Device/prototype/hardwareType.mdx new file mode 100644 index 0000000000..dc383215f5 --- /dev/null +++ b/documentation/docs/fastly:device/Device/prototype/hardwareType.mdx @@ -0,0 +1,18 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.hardwareType + +The read-only **`hardwareType`** property of the `Device` interface is +either a string stating the hardware type of the device, or `null` if the hardware type is not known. + +A string representation of the device's primary platform hardware. The most commonly used device types are also identified via boolean variables. Because a device may have multiple device types and this variable only has the primary type, we recommend using the boolean variables for logic and using this string representation for logging. + + + +## Value + +Either a string value if a hardware type is known, otherwise `null`. diff --git a/documentation/docs/fastly:device/Device/prototype/isDesktop.mdx b/documentation/docs/fastly:device/Device/prototype/isDesktop.mdx new file mode 100644 index 0000000000..f5993762ce --- /dev/null +++ b/documentation/docs/fastly:device/Device/prototype/isDesktop.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isDesktop + +The read-only **`isDesktop`** property of the `Device` interface is +either a boolean stating if the device is a desktop web browser, or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device is a desktop web browser, or `null` if the this is not known. diff --git a/documentation/docs/fastly:device/Device/prototype/isGameConsole.mdx b/documentation/docs/fastly:device/Device/prototype/isGameConsole.mdx new file mode 100644 index 0000000000..839735ae4a --- /dev/null +++ b/documentation/docs/fastly:device/Device/prototype/isGameConsole.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isGameConsole + +The read-only **`isGameConsole`** property of the `Device` interface is +either a boolean stating if the device is a video game console, or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device is a video game console, or `null` if the this is not known. diff --git a/documentation/docs/fastly:device/Device/prototype/isMediaPlayer.mdx b/documentation/docs/fastly:device/Device/prototype/isMediaPlayer.mdx new file mode 100644 index 0000000000..391c5dc168 --- /dev/null +++ b/documentation/docs/fastly:device/Device/prototype/isMediaPlayer.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isMediaPlayer + +The read-only **`isMediaPlayer`** property of the `Device` interface is +either a boolean stating if the device is a media player (like Blu-ray players, iPod devices, and smart speakers such as Amazon Echo), or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device is a media player (like Blu-ray players, iPod devices, and smart speakers such as Amazon Echo), or `null` if the this is not known. diff --git a/documentation/docs/fastly:device/Device/prototype/isMobile.mdx b/documentation/docs/fastly:device/Device/prototype/isMobile.mdx new file mode 100644 index 0000000000..507ed050fc --- /dev/null +++ b/documentation/docs/fastly:device/Device/prototype/isMobile.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isMobile + +The read-only **`isMobile`** property of the `Device` interface is +either a boolean stating if the device is a mobile phone, or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device is a mobile phone, or `null` if the this is not known. diff --git a/documentation/docs/fastly:device/Device/prototype/isSmartTV.mdx b/documentation/docs/fastly:device/Device/prototype/isSmartTV.mdx new file mode 100644 index 0000000000..9619f66473 --- /dev/null +++ b/documentation/docs/fastly:device/Device/prototype/isSmartTV.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isSmartTV + +The read-only **`isSmartTV`** property of the `Device` interface is +either a boolean stating if the device is a smart TV, or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device is a smart TV, or `null` if the this is not known. diff --git a/documentation/docs/fastly:device/Device/prototype/isTablet.mdx b/documentation/docs/fastly:device/Device/prototype/isTablet.mdx new file mode 100644 index 0000000000..429a1cceb9 --- /dev/null +++ b/documentation/docs/fastly:device/Device/prototype/isTablet.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isTablet + +The read-only **`isTablet`** property of the `Device` interface is +either a boolean stating if the device is a tablet (like an iPad), or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device is a tablet (like an iPad), or `null` if the this is not known. diff --git a/documentation/docs/fastly:device/Device/prototype/isTouchscreen.mdx b/documentation/docs/fastly:device/Device/prototype/isTouchscreen.mdx new file mode 100644 index 0000000000..3c951c2b76 --- /dev/null +++ b/documentation/docs/fastly:device/Device/prototype/isTouchscreen.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isTouchscreen + +The read-only **`isTouchscreen`** property of the `Device` interface is +either a boolean stating if the device's screen is touch sensitive, or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device's screen is touch sensitive, or `null` if the this is not known. diff --git a/documentation/docs/fastly:device/Device/prototype/model.mdx b/documentation/docs/fastly:device/Device/prototype/model.mdx new file mode 100644 index 0000000000..782c9cef60 --- /dev/null +++ b/documentation/docs/fastly:device/Device/prototype/model.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.model + +The read-only **`model`** property of the `Device` interface is +either a string stating the model of the device, or `null` if the model is not known. + + +## Value + +Either a string value if a model is known, otherwise `null`. diff --git a/documentation/docs/fastly:device/Device/prototype/name.mdx b/documentation/docs/fastly:device/Device/prototype/name.mdx new file mode 100644 index 0000000000..468c436c21 --- /dev/null +++ b/documentation/docs/fastly:device/Device/prototype/name.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.name + +The read-only **`name`** property of the `Device` interface is +either a string stating the name of the device, or `null` if the name is not known. + + +## Value + +Either a string value if a name is known, otherwise `null`. diff --git a/documentation/docs/fastly:device/Device/prototype/toJSON.mdx b/documentation/docs/fastly:device/Device/prototype/toJSON.mdx new file mode 100644 index 0000000000..505c2e1734 --- /dev/null +++ b/documentation/docs/fastly:device/Device/prototype/toJSON.mdx @@ -0,0 +1,24 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +import {Fiddle} from '@site/src/components/fiddle'; + +# toJSON + +The `toJSON()` method of the Device interface is a serializer; +it returns a JSON representation of the Device object. + +To get a JSON string, you can use `JSON.stringify(device)` directly; it will call `toJSON()` automatically. + +## Syntax + +```js +toJSON() +``` + +### Return value + +A JSON object that is the serialization of the Device object. diff --git a/documentation/versioned_docs/version-1.0.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-1.0.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 7cc609be1b..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,219 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-1.0.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index cbe239b65a..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-1.0.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index 3150c2b00d..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; - -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-1.0.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index 4582202621..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; - -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-1.0.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 4c0bdcd15c..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; - -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-1.0.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index ea83d3a203..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; - -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-1.0.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 1518f6c678..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,102 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; - -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/fastly:env/env.mdx b/documentation/versioned_docs/version-1.0.0/fastly:env/env.mdx deleted file mode 100644 index 441c7a3cd7..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:env/env.mdx +++ /dev/null @@ -1,100 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ------- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; - -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - - return new Response("", { - status: 200 - }); -} - -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-1.0.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 048a9b5d55..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ------- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-1.0.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index c0393c28d7..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.mdx file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.mdx'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-1.0.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-1.0.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index 2aee449e49..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,182 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" - -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} - -addEventListener("fetch", event => event.respondWith(app(event))); - -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-1.0.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 69874feae6..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; - -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} - -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-1.0.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 25b2130f03..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; - -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} - -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/fastly:object-store/ObjectStore/ObjectStore.mdx b/documentation/versioned_docs/version-1.0.0/fastly:object-store/ObjectStore/ObjectStore.mdx deleted file mode 100644 index 795a52d099..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:object-store/ObjectStore/ObjectStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `ObjectStore()` - -The **`ObjectStore` constructor** lets you connect your Fastly Compute application to a Fastly Object store. - -An object store is a persistent, globally consistent key-value store. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ObjectStore(name) -``` - -> **Note:** `ObjectStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Object store which should be associated with this ObjectStore instance - -### Return value - -A new `ObjectStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Object Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.0.0/fastly:object-store/ObjectStore/prototype/get.mdx b/documentation/versioned_docs/version-1.0.0/fastly:object-store/ObjectStore/prototype/get.mdx deleted file mode 100644 index 55eb5ccb28..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:object-store/ObjectStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Object store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Object-store. - -### Return value - -If the key does not exist in the Object store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Object store, this returns a `Promise` which resolves with an `ObjectStoreEntry`. - -## Description - -Send the given message, converted to a string, to this ObjectStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.0.0/fastly:object-store/ObjectStore/prototype/put.mdx b/documentation/versioned_docs/version-1.0.0/fastly:object-store/ObjectStore/prototype/put.mdx deleted file mode 100644 index ca4fd740ea..0000000000 --- a/documentation/versioned_docs/version-1.0.0/fastly:object-store/ObjectStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.put - -The **`put()`** method stores a `value` into the Object store under a `key`. - -> **Note**: Object stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the Object store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the Object store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the Object store. - -## Description - -Stores the supplied `value` into the Object store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1659afd87c..0000000000 --- a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with a implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.0.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-1.0.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 8ebab02761..0000000000 --- a/documentation/versioned_docs/version-1.0.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.mdx#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.0.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-1.0.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index c4983590a6..0000000000 --- a/documentation/versioned_docs/version-1.0.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.mdx#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-1.0.0/globals/Math/imul.mdx deleted file mode 100644 index de22ddc20c..0000000000 --- a/documentation/versioned_docs/version-1.0.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-1.0.0/globals/Proxy/revocable.mdx deleted file mode 100644 index e86740d161..0000000000 --- a/documentation/versioned_docs/version-1.0.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [handler)`](../../globals/Proxy/Proxy.mdx `new Proxy(target,) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 9c490b51e9..0000000000 --- a/documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : An property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-1.0.0/globals/Request/Request.mdx deleted file mode 100644 index 7e60acdf8a..0000000000 --- a/documentation/versioned_docs/version-1.0.0/globals/Request/Request.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - A string which is the name of the Fastly configured backend the request should be sent to. - - `cacheOverride` _**Fastly-specific**_ - - A [`CacheOverride`](../../fastly%3Acache-override/CacheOverride/CacheOverride.mdx) object, used to configure the caching behaviour of the returned [`Response`](../Response/Response.mdx). - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.0.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-1.0.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-1.0.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-1.0.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index 86c60bd0c2..0000000000 --- a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-1.0.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index 3626eb5c5c..0000000000 --- a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx ), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-1.0.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index 0a2937279d..0000000000 --- a/documentation/versioned_docs/version-1.0.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx]. diff --git a/documentation/versioned_docs/version-1.0.0/globals/fetch.mdx b/documentation/versioned_docs/version-1.0.0/globals/fetch.mdx deleted file mode 100644 index 50d50fd57f..0000000000 --- a/documentation/versioned_docs/version-1.0.0/globals/fetch.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - A string which is the name of the Fastly configured backend the request should be sent to. - - `cacheOverride` _**Fastly-specific**_ - - A [`CacheOverride`](../fastly%3Acache-override/CacheOverride/CacheOverride.mdx) object, used to configure the caching behaviour of the returned [`Response`](./Response/Response.mdx). - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-1.1.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-1.1.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-1.1.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.1.0/fastly:object-store/ObjectStore/ObjectStore.mdx b/documentation/versioned_docs/version-1.1.0/fastly:object-store/ObjectStore/ObjectStore.mdx deleted file mode 100644 index 795a52d099..0000000000 --- a/documentation/versioned_docs/version-1.1.0/fastly:object-store/ObjectStore/ObjectStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `ObjectStore()` - -The **`ObjectStore` constructor** lets you connect your Fastly Compute application to a Fastly Object store. - -An object store is a persistent, globally consistent key-value store. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ObjectStore(name) -``` - -> **Note:** `ObjectStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Object store which should be associated with this ObjectStore instance - -### Return value - -A new `ObjectStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Object Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.1.0/fastly:object-store/ObjectStore/prototype/get.mdx b/documentation/versioned_docs/version-1.1.0/fastly:object-store/ObjectStore/prototype/get.mdx deleted file mode 100644 index 55eb5ccb28..0000000000 --- a/documentation/versioned_docs/version-1.1.0/fastly:object-store/ObjectStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Object store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Object-store. - -### Return value - -If the key does not exist in the Object store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Object store, this returns a `Promise` which resolves with an `ObjectStoreEntry`. - -## Description - -Send the given message, converted to a string, to this ObjectStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.1.0/fastly:object-store/ObjectStore/prototype/put.mdx b/documentation/versioned_docs/version-1.1.0/fastly:object-store/ObjectStore/prototype/put.mdx deleted file mode 100644 index ca4fd740ea..0000000000 --- a/documentation/versioned_docs/version-1.1.0/fastly:object-store/ObjectStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.put - -The **`put()`** method stores a `value` into the Object store under a `key`. - -> **Note**: Object stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the Object store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the Object store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the Object store. - -## Description - -Stores the supplied `value` into the Object store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-1.1.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/from.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/of.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1659afd87c..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with a implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-1.1.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-1.1.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.1.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-1.1.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-1.1.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-1.1.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.1.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-1.1.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-1.1.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-1.1.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-1.1.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-1.1.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-1.1.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.1.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.1.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.1.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/now.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-1.1.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.1.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.1.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-1.1.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-1.1.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-1.1.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-1.1.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-1.1.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-1.1.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.1.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-1.1.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-1.1.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-1.1.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-1.1.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-1.1.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-1.1.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-1.1.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-1.1.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-1.1.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Infinity.mdx b/documentation/versioned_docs/version-1.1.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-1.1.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-1.1.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-1.1.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.1.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-1.1.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-1.1.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-1.1.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-1.1.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-1.1.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/E.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/log.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/max.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/min.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/random.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/round.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-1.1.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/NaN.mdx b/documentation/versioned_docs/version-1.1.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/create.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/is.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Object/values.mdx b/documentation/versioned_docs/version-1.1.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-1.1.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-1.1.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-1.1.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-1.1.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-1.1.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-1.1.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-1.1.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-1.1.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-1.1.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-1.1.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-1.1.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-1.1.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 9c490b51e9..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : An property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-1.1.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-1.1.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-1.1.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-1.1.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-1.1.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-1.1.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.1.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-1.1.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-1.1.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-1.1.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-1.1.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-1.1.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-1.1.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-1.1.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-1.1.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-1.1.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.1.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-1.1.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-1.1.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/String.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index 86c60bd0c2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/raw.mdx b/documentation/versioned_docs/version-1.1.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-1.1.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-1.1.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-1.1.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-1.1.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-1.1.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-1.1.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-1.1.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.1.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-1.1.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-1.1.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-1.1.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.1.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.1.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.1.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-1.1.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-1.1.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.1.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-1.1.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-1.1.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-1.1.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.1.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-1.1.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.1.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-1.1.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-1.1.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-1.1.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-1.1.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-1.1.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-1.1.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-1.1.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-1.1.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.1.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-1.1.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-1.1.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-1.1.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.1.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-1.1.0/globals/atob.mdx b/documentation/versioned_docs/version-1.1.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-1.1.0/globals/btoa.mdx b/documentation/versioned_docs/version-1.1.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-1.1.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-1.1.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-1.1.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/console/debug.mdx b/documentation/versioned_docs/version-1.1.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/console/error.mdx b/documentation/versioned_docs/version-1.1.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.1.0/globals/console/info.mdx b/documentation/versioned_docs/version-1.1.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/console/log.mdx b/documentation/versioned_docs/version-1.1.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/console/warn.mdx b/documentation/versioned_docs/version-1.1.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-1.1.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-1.1.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-1.1.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-1.1.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-1.1.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-1.1.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-1.1.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/escape.mdx b/documentation/versioned_docs/version-1.1.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-1.1.0/globals/eval.mdx b/documentation/versioned_docs/version-1.1.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-1.1.0/globals/fetch.mdx b/documentation/versioned_docs/version-1.1.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/globalThis.mdx b/documentation/versioned_docs/version-1.1.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-1.1.0/globals/isFinite.mdx b/documentation/versioned_docs/version-1.1.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/isNaN.mdx b/documentation/versioned_docs/version-1.1.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-1.1.0/globals/location.mdx b/documentation/versioned_docs/version-1.1.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-1.1.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-1.1.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-1.1.0/globals/parseInt.mdx b/documentation/versioned_docs/version-1.1.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/setInterval.mdx b/documentation/versioned_docs/version-1.1.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-1.1.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-1.1.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-1.1.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-1.1.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-1.1.0/globals/undefined.mdx b/documentation/versioned_docs/version-1.1.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-1.1.0/globals/unescape.mdx b/documentation/versioned_docs/version-1.1.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-1.1.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-1.1.0/index.mdx b/documentation/versioned_docs/version-1.1.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-1.1.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-1.10.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-1.10.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-1.10.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-1.10.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-1.10.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-1.10.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-1.10.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-1.10.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/fastly:env/env.mdx b/documentation/versioned_docs/version-1.10.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-1.10.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-1.10.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-1.10.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-1.10.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-1.10.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-1.10.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/fastly:object-store/ObjectStore/ObjectStore.mdx b/documentation/versioned_docs/version-1.10.0/fastly:object-store/ObjectStore/ObjectStore.mdx deleted file mode 100644 index beff84fedb..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:object-store/ObjectStore/ObjectStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `ObjectStore()` - -The **`ObjectStore` constructor** lets you connect your Fastly Compute application to a Fastly Object store. - -An object store is a persistent, globally consistent key-value store. See https://developer.fastly.com/learning/concepts/data-stores/#object-stores for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ObjectStore(name) -``` - -> **Note:** `ObjectStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Object store which should be associated with this ObjectStore instance - -### Return value - -A new `ObjectStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Object Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.10.0/fastly:object-store/ObjectStore/prototype/get.mdx b/documentation/versioned_docs/version-1.10.0/fastly:object-store/ObjectStore/prototype/get.mdx deleted file mode 100644 index 55eb5ccb28..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:object-store/ObjectStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Object store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Object-store. - -### Return value - -If the key does not exist in the Object store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Object store, this returns a `Promise` which resolves with an `ObjectStoreEntry`. - -## Description - -Send the given message, converted to a string, to this ObjectStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.10.0/fastly:object-store/ObjectStore/prototype/put.mdx b/documentation/versioned_docs/version-1.10.0/fastly:object-store/ObjectStore/prototype/put.mdx deleted file mode 100644 index ca4fd740ea..0000000000 --- a/documentation/versioned_docs/version-1.10.0/fastly:object-store/ObjectStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.put - -The **`put()`** method stores a `value` into the Object store under a `key`. - -> **Note**: Object stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the Object store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the Object store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the Object store. - -## Description - -Stores the supplied `value` into the Object store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-1.10.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/from.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/of.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-1.10.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-1.10.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-1.10.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.10.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-1.10.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.10.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.10.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-1.10.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-1.10.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-1.10.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.10.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-1.10.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-1.10.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-1.10.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-1.10.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-1.10.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-1.10.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.10.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.10.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.10.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/now.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-1.10.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.10.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.10.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-1.10.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-1.10.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-1.10.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-1.10.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-1.10.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-1.10.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.10.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-1.10.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-1.10.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-1.10.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-1.10.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-1.10.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-1.10.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-1.10.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-1.10.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-1.10.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-1.10.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-1.10.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Infinity.mdx b/documentation/versioned_docs/version-1.10.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-1.10.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-1.10.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-1.10.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.10.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-1.10.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-1.10.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-1.10.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-1.10.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-1.10.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/E.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/log.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/max.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/min.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/random.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/round.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-1.10.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/NaN.mdx b/documentation/versioned_docs/version-1.10.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/create.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/is.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Object/values.mdx b/documentation/versioned_docs/version-1.10.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-1.10.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-1.10.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-1.10.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-1.10.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-1.10.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-1.10.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-1.10.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-1.10.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-1.10.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-1.10.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-1.10.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-1.10.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-1.10.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-1.10.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-1.10.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-1.10.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-1.10.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-1.10.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-1.10.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-1.10.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.10.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-1.10.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-1.10.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-1.10.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-1.10.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-1.10.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-1.10.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-1.10.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-1.10.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-1.10.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.10.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-1.10.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 6454b50cf1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - > **Warning:** Although you can technically pass `SHA-1` here, this is strongly discouraged as it is considered vulnerable. - diff --git a/documentation/versioned_docs/version-1.10.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-1.10.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-1.10.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/String.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/raw.mdx b/documentation/versioned_docs/version-1.10.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 84b2377074..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index 2acf2af4a1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - diff --git a/documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index d18b3b1c99..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-1.10.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-1.10.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-1.10.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-1.10.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-1.10.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-1.10.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-1.10.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.10.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-1.10.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-1.10.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-1.10.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.10.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.10.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.10.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-1.10.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-1.10.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.10.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-1.10.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-1.10.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-1.10.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.10.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-1.10.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.10.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-1.10.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-1.10.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-1.10.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-1.10.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-1.10.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-1.10.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-1.10.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-1.10.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.10.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-1.10.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-1.10.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-1.10.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.10.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-1.10.0/globals/atob.mdx b/documentation/versioned_docs/version-1.10.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-1.10.0/globals/btoa.mdx b/documentation/versioned_docs/version-1.10.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-1.10.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-1.10.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-1.10.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/console/debug.mdx b/documentation/versioned_docs/version-1.10.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/console/error.mdx b/documentation/versioned_docs/version-1.10.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/globals/console/info.mdx b/documentation/versioned_docs/version-1.10.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/console/log.mdx b/documentation/versioned_docs/version-1.10.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/console/warn.mdx b/documentation/versioned_docs/version-1.10.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-1.10.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-1.10.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-1.10.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.10.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-1.10.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-1.10.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-1.10.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-1.10.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-1.10.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/escape.mdx b/documentation/versioned_docs/version-1.10.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-1.10.0/globals/eval.mdx b/documentation/versioned_docs/version-1.10.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-1.10.0/globals/fetch.mdx b/documentation/versioned_docs/version-1.10.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/globalThis.mdx b/documentation/versioned_docs/version-1.10.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-1.10.0/globals/isFinite.mdx b/documentation/versioned_docs/version-1.10.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/isNaN.mdx b/documentation/versioned_docs/version-1.10.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-1.10.0/globals/location.mdx b/documentation/versioned_docs/version-1.10.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-1.10.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-1.10.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-1.10.0/globals/parseInt.mdx b/documentation/versioned_docs/version-1.10.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/setInterval.mdx b/documentation/versioned_docs/version-1.10.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-1.10.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-1.10.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-1.10.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-1.10.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-1.10.0/globals/undefined.mdx b/documentation/versioned_docs/version-1.10.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-1.10.0/globals/unescape.mdx b/documentation/versioned_docs/version-1.10.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-1.10.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-1.10.0/index.mdx b/documentation/versioned_docs/version-1.10.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-1.10.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-1.11.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-1.11.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-1.11.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-1.11.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-1.11.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-1.11.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-1.11.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-1.11.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/fastly:env/env.mdx b/documentation/versioned_docs/version-1.11.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-1.11.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-1.11.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-1.11.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-1.11.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-1.11.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-1.11.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/fastly:object-store/ObjectStore/ObjectStore.mdx b/documentation/versioned_docs/version-1.11.0/fastly:object-store/ObjectStore/ObjectStore.mdx deleted file mode 100644 index beff84fedb..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:object-store/ObjectStore/ObjectStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `ObjectStore()` - -The **`ObjectStore` constructor** lets you connect your Fastly Compute application to a Fastly Object store. - -An object store is a persistent, globally consistent key-value store. See https://developer.fastly.com/learning/concepts/data-stores/#object-stores for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ObjectStore(name) -``` - -> **Note:** `ObjectStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Object store which should be associated with this ObjectStore instance - -### Return value - -A new `ObjectStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Object Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.11.0/fastly:object-store/ObjectStore/prototype/get.mdx b/documentation/versioned_docs/version-1.11.0/fastly:object-store/ObjectStore/prototype/get.mdx deleted file mode 100644 index 55eb5ccb28..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:object-store/ObjectStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Object store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Object-store. - -### Return value - -If the key does not exist in the Object store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Object store, this returns a `Promise` which resolves with an `ObjectStoreEntry`. - -## Description - -Send the given message, converted to a string, to this ObjectStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.11.0/fastly:object-store/ObjectStore/prototype/put.mdx b/documentation/versioned_docs/version-1.11.0/fastly:object-store/ObjectStore/prototype/put.mdx deleted file mode 100644 index ca4fd740ea..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:object-store/ObjectStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.put - -The **`put()`** method stores a `value` into the Object store under a `key`. - -> **Note**: Object stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the Object store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the Object store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the Object store. - -## Description - -Stores the supplied `value` into the Object store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.11.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-1.11.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.11.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-1.11.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.11.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-1.11.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-1.11.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-1.11.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/from.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/of.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-1.11.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-1.11.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-1.11.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.11.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-1.11.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.11.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.11.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-1.11.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-1.11.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-1.11.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.11.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-1.11.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-1.11.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-1.11.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-1.11.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-1.11.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-1.11.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.11.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.11.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.11.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/now.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-1.11.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.11.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.11.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-1.11.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-1.11.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-1.11.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-1.11.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-1.11.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-1.11.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.11.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-1.11.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-1.11.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-1.11.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-1.11.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-1.11.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-1.11.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-1.11.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-1.11.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-1.11.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-1.11.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-1.11.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-1.11.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-1.11.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Infinity.mdx b/documentation/versioned_docs/version-1.11.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-1.11.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-1.11.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-1.11.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.11.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-1.11.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-1.11.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-1.11.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-1.11.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-1.11.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/E.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/log.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/max.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/min.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/random.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/round.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-1.11.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/NaN.mdx b/documentation/versioned_docs/version-1.11.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/create.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/is.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Object/values.mdx b/documentation/versioned_docs/version-1.11.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-1.11.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-1.11.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-1.11.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-1.11.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-1.11.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-1.11.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-1.11.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-1.11.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-1.11.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-1.11.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-1.11.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-1.11.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-1.11.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-1.11.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-1.11.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-1.11.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-1.11.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-1.11.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-1.11.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-1.11.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.11.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-1.11.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-1.11.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-1.11.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-1.11.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-1.11.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-1.11.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-1.11.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-1.11.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-1.11.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-1.11.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 6454b50cf1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - > **Warning:** Although you can technically pass `SHA-1` here, this is strongly discouraged as it is considered vulnerable. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-1.11.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-1.11.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/String.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.11.0/globals/String/raw.mdx b/documentation/versioned_docs/version-1.11.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 84b2377074..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index 2acf2af4a1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - diff --git a/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index d18b3b1c99..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-1.11.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-1.11.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-1.11.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-1.11.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-1.11.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-1.11.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-1.11.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.11.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-1.11.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-1.11.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.11.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.11.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.11.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-1.11.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-1.11.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.11.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-1.11.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-1.11.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-1.11.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.11.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-1.11.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.11.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-1.11.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-1.11.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-1.11.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-1.11.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-1.11.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-1.11.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-1.11.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-1.11.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.11.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-1.11.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-1.11.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-1.11.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.11.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-1.11.0/globals/atob.mdx b/documentation/versioned_docs/version-1.11.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-1.11.0/globals/btoa.mdx b/documentation/versioned_docs/version-1.11.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-1.11.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-1.11.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-1.11.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/console/debug.mdx b/documentation/versioned_docs/version-1.11.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/console/error.mdx b/documentation/versioned_docs/version-1.11.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/globals/console/info.mdx b/documentation/versioned_docs/version-1.11.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/console/log.mdx b/documentation/versioned_docs/version-1.11.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/console/warn.mdx b/documentation/versioned_docs/version-1.11.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-1.11.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-1.11.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-1.11.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.11.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-1.11.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-1.11.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-1.11.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-1.11.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-1.11.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-1.11.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-1.11.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/escape.mdx b/documentation/versioned_docs/version-1.11.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-1.11.0/globals/eval.mdx b/documentation/versioned_docs/version-1.11.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-1.11.0/globals/fetch.mdx b/documentation/versioned_docs/version-1.11.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/globalThis.mdx b/documentation/versioned_docs/version-1.11.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-1.11.0/globals/isFinite.mdx b/documentation/versioned_docs/version-1.11.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/isNaN.mdx b/documentation/versioned_docs/version-1.11.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-1.11.0/globals/location.mdx b/documentation/versioned_docs/version-1.11.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-1.11.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-1.11.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-1.11.0/globals/parseInt.mdx b/documentation/versioned_docs/version-1.11.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/setInterval.mdx b/documentation/versioned_docs/version-1.11.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-1.11.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-1.11.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-1.11.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-1.11.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-1.11.0/globals/undefined.mdx b/documentation/versioned_docs/version-1.11.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-1.11.0/globals/unescape.mdx b/documentation/versioned_docs/version-1.11.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-1.11.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-1.11.0/index.mdx b/documentation/versioned_docs/version-1.11.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-1.11.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-1.12.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-1.12.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-1.12.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-1.12.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-1.12.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-1.12.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-1.12.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-1.12.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/fastly:env/env.mdx b/documentation/versioned_docs/version-1.12.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-1.12.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-1.12.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-1.12.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-1.12.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-1.12.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-1.12.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/fastly:object-store/ObjectStore/ObjectStore.mdx b/documentation/versioned_docs/version-1.12.0/fastly:object-store/ObjectStore/ObjectStore.mdx deleted file mode 100644 index beff84fedb..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:object-store/ObjectStore/ObjectStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `ObjectStore()` - -The **`ObjectStore` constructor** lets you connect your Fastly Compute application to a Fastly Object store. - -An object store is a persistent, globally consistent key-value store. See https://developer.fastly.com/learning/concepts/data-stores/#object-stores for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ObjectStore(name) -``` - -> **Note:** `ObjectStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Object store which should be associated with this ObjectStore instance - -### Return value - -A new `ObjectStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Object Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.12.0/fastly:object-store/ObjectStore/prototype/get.mdx b/documentation/versioned_docs/version-1.12.0/fastly:object-store/ObjectStore/prototype/get.mdx deleted file mode 100644 index 55eb5ccb28..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:object-store/ObjectStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Object store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Object-store. - -### Return value - -If the key does not exist in the Object store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Object store, this returns a `Promise` which resolves with an `ObjectStoreEntry`. - -## Description - -Send the given message, converted to a string, to this ObjectStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.12.0/fastly:object-store/ObjectStore/prototype/put.mdx b/documentation/versioned_docs/version-1.12.0/fastly:object-store/ObjectStore/prototype/put.mdx deleted file mode 100644 index ca4fd740ea..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:object-store/ObjectStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.put - -The **`put()`** method stores a `value` into the Object store under a `key`. - -> **Note**: Object stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the Object store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the Object store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the Object store. - -## Description - -Stores the supplied `value` into the Object store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.12.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-1.12.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.12.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-1.12.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.12.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-1.12.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-1.12.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-1.12.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/from.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/of.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-1.12.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-1.12.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-1.12.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.12.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-1.12.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.12.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.12.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-1.12.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-1.12.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-1.12.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.12.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-1.12.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-1.12.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-1.12.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-1.12.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-1.12.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-1.12.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.12.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.12.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.12.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/now.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-1.12.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.12.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.12.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-1.12.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-1.12.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-1.12.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-1.12.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-1.12.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-1.12.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.12.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-1.12.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-1.12.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-1.12.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-1.12.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-1.12.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-1.12.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-1.12.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-1.12.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-1.12.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-1.12.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-1.12.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-1.12.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-1.12.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Infinity.mdx b/documentation/versioned_docs/version-1.12.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-1.12.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-1.12.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-1.12.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.12.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-1.12.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-1.12.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-1.12.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-1.12.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-1.12.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/E.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/log.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/max.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/min.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/random.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/round.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-1.12.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/NaN.mdx b/documentation/versioned_docs/version-1.12.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/create.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/is.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Object/values.mdx b/documentation/versioned_docs/version-1.12.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-1.12.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-1.12.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-1.12.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-1.12.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-1.12.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-1.12.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-1.12.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-1.12.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-1.12.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-1.12.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-1.12.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-1.12.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-1.12.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-1.12.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-1.12.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-1.12.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-1.12.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-1.12.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-1.12.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-1.12.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.12.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-1.12.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-1.12.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-1.12.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-1.12.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-1.12.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-1.12.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-1.12.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-1.12.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-1.12.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-1.12.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 6454b50cf1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - > **Warning:** Although you can technically pass `SHA-1` here, this is strongly discouraged as it is considered vulnerable. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-1.12.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-1.12.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/String.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.12.0/globals/String/raw.mdx b/documentation/versioned_docs/version-1.12.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 84b2377074..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index 2acf2af4a1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - diff --git a/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index d18b3b1c99..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-1.12.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-1.12.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-1.12.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-1.12.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-1.12.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-1.12.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-1.12.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.12.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-1.12.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-1.12.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.12.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.12.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.12.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-1.12.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-1.12.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.12.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-1.12.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-1.12.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-1.12.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.12.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-1.12.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.12.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-1.12.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-1.12.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-1.12.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-1.12.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-1.12.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-1.12.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-1.12.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-1.12.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.12.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-1.12.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-1.12.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-1.12.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.12.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-1.12.0/globals/atob.mdx b/documentation/versioned_docs/version-1.12.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-1.12.0/globals/btoa.mdx b/documentation/versioned_docs/version-1.12.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-1.12.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-1.12.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-1.12.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/console/debug.mdx b/documentation/versioned_docs/version-1.12.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/console/error.mdx b/documentation/versioned_docs/version-1.12.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/globals/console/info.mdx b/documentation/versioned_docs/version-1.12.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/console/log.mdx b/documentation/versioned_docs/version-1.12.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/console/warn.mdx b/documentation/versioned_docs/version-1.12.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-1.12.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-1.12.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-1.12.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.12.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-1.12.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-1.12.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-1.12.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-1.12.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-1.12.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-1.12.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-1.12.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/escape.mdx b/documentation/versioned_docs/version-1.12.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-1.12.0/globals/eval.mdx b/documentation/versioned_docs/version-1.12.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-1.12.0/globals/fetch.mdx b/documentation/versioned_docs/version-1.12.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/globalThis.mdx b/documentation/versioned_docs/version-1.12.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-1.12.0/globals/isFinite.mdx b/documentation/versioned_docs/version-1.12.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/isNaN.mdx b/documentation/versioned_docs/version-1.12.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-1.12.0/globals/location.mdx b/documentation/versioned_docs/version-1.12.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-1.12.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-1.12.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-1.12.0/globals/parseInt.mdx b/documentation/versioned_docs/version-1.12.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/setInterval.mdx b/documentation/versioned_docs/version-1.12.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-1.12.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-1.12.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-1.12.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-1.12.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-1.12.0/globals/undefined.mdx b/documentation/versioned_docs/version-1.12.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-1.12.0/globals/unescape.mdx b/documentation/versioned_docs/version-1.12.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-1.12.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-1.12.0/index.mdx b/documentation/versioned_docs/version-1.12.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-1.12.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-1.2.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-1.2.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-1.2.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-1.2.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-1.2.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-1.2.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-1.2.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-1.2.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/fastly:env/env.mdx b/documentation/versioned_docs/version-1.2.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-1.2.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-1.2.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-1.2.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-1.2.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-1.2.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-1.2.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/fastly:object-store/ObjectStore/ObjectStore.mdx b/documentation/versioned_docs/version-1.2.0/fastly:object-store/ObjectStore/ObjectStore.mdx deleted file mode 100644 index 795a52d099..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:object-store/ObjectStore/ObjectStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `ObjectStore()` - -The **`ObjectStore` constructor** lets you connect your Fastly Compute application to a Fastly Object store. - -An object store is a persistent, globally consistent key-value store. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ObjectStore(name) -``` - -> **Note:** `ObjectStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Object store which should be associated with this ObjectStore instance - -### Return value - -A new `ObjectStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Object Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.2.0/fastly:object-store/ObjectStore/prototype/get.mdx b/documentation/versioned_docs/version-1.2.0/fastly:object-store/ObjectStore/prototype/get.mdx deleted file mode 100644 index 55eb5ccb28..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:object-store/ObjectStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Object store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Object-store. - -### Return value - -If the key does not exist in the Object store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Object store, this returns a `Promise` which resolves with an `ObjectStoreEntry`. - -## Description - -Send the given message, converted to a string, to this ObjectStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.2.0/fastly:object-store/ObjectStore/prototype/put.mdx b/documentation/versioned_docs/version-1.2.0/fastly:object-store/ObjectStore/prototype/put.mdx deleted file mode 100644 index ca4fd740ea..0000000000 --- a/documentation/versioned_docs/version-1.2.0/fastly:object-store/ObjectStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.put - -The **`put()`** method stores a `value` into the Object store under a `key`. - -> **Note**: Object stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the Object store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the Object store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the Object store. - -## Description - -Stores the supplied `value` into the Object store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-1.2.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/from.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/of.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1659afd87c..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with a implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-1.2.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-1.2.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-1.2.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.2.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-1.2.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.2.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.2.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-1.2.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-1.2.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-1.2.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.2.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-1.2.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-1.2.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-1.2.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-1.2.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-1.2.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-1.2.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.2.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.2.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.2.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/now.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-1.2.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.2.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.2.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-1.2.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-1.2.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-1.2.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-1.2.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-1.2.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-1.2.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.2.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-1.2.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-1.2.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-1.2.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-1.2.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-1.2.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-1.2.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-1.2.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-1.2.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-1.2.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Infinity.mdx b/documentation/versioned_docs/version-1.2.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-1.2.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-1.2.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-1.2.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.2.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-1.2.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-1.2.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-1.2.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-1.2.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-1.2.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/E.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/log.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/max.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/min.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/random.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/round.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-1.2.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/NaN.mdx b/documentation/versioned_docs/version-1.2.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/create.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/is.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Object/values.mdx b/documentation/versioned_docs/version-1.2.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-1.2.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-1.2.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-1.2.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-1.2.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-1.2.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-1.2.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-1.2.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-1.2.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-1.2.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-1.2.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-1.2.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-1.2.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-1.2.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-1.2.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 9c490b51e9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : An property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-1.2.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-1.2.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-1.2.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-1.2.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-1.2.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-1.2.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.2.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-1.2.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-1.2.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-1.2.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-1.2.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-1.2.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-1.2.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-1.2.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-1.2.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-1.2.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.2.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-1.2.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-1.2.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/String.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index 86c60bd0c2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.2.0/globals/String/raw.mdx b/documentation/versioned_docs/version-1.2.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-1.2.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-1.2.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-1.2.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-1.2.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-1.2.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-1.2.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-1.2.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.2.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-1.2.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-1.2.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-1.2.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.2.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.2.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.2.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-1.2.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-1.2.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.2.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-1.2.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-1.2.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-1.2.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.2.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-1.2.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.2.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-1.2.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-1.2.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-1.2.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-1.2.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-1.2.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-1.2.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-1.2.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-1.2.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.2.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-1.2.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-1.2.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-1.2.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.2.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-1.2.0/globals/atob.mdx b/documentation/versioned_docs/version-1.2.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-1.2.0/globals/btoa.mdx b/documentation/versioned_docs/version-1.2.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-1.2.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-1.2.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-1.2.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/console/debug.mdx b/documentation/versioned_docs/version-1.2.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/console/error.mdx b/documentation/versioned_docs/version-1.2.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/globals/console/info.mdx b/documentation/versioned_docs/version-1.2.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/console/log.mdx b/documentation/versioned_docs/version-1.2.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/console/warn.mdx b/documentation/versioned_docs/version-1.2.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-1.2.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-1.2.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-1.2.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.2.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-1.2.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-1.2.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-1.2.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-1.2.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-1.2.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/escape.mdx b/documentation/versioned_docs/version-1.2.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-1.2.0/globals/eval.mdx b/documentation/versioned_docs/version-1.2.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-1.2.0/globals/fetch.mdx b/documentation/versioned_docs/version-1.2.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/globalThis.mdx b/documentation/versioned_docs/version-1.2.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-1.2.0/globals/isFinite.mdx b/documentation/versioned_docs/version-1.2.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/isNaN.mdx b/documentation/versioned_docs/version-1.2.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-1.2.0/globals/location.mdx b/documentation/versioned_docs/version-1.2.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-1.2.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-1.2.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-1.2.0/globals/parseInt.mdx b/documentation/versioned_docs/version-1.2.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/setInterval.mdx b/documentation/versioned_docs/version-1.2.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-1.2.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-1.2.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-1.2.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-1.2.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-1.2.0/globals/undefined.mdx b/documentation/versioned_docs/version-1.2.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-1.2.0/globals/unescape.mdx b/documentation/versioned_docs/version-1.2.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-1.2.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-1.2.0/index.mdx b/documentation/versioned_docs/version-1.2.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-1.2.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-1.3.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-1.3.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-1.3.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-1.3.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-1.3.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-1.3.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-1.3.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-1.3.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/fastly:env/env.mdx b/documentation/versioned_docs/version-1.3.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-1.3.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-1.3.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-1.3.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-1.3.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-1.3.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-1.3.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/fastly:object-store/ObjectStore/ObjectStore.mdx b/documentation/versioned_docs/version-1.3.0/fastly:object-store/ObjectStore/ObjectStore.mdx deleted file mode 100644 index 795a52d099..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:object-store/ObjectStore/ObjectStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `ObjectStore()` - -The **`ObjectStore` constructor** lets you connect your Fastly Compute application to a Fastly Object store. - -An object store is a persistent, globally consistent key-value store. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ObjectStore(name) -``` - -> **Note:** `ObjectStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Object store which should be associated with this ObjectStore instance - -### Return value - -A new `ObjectStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Object Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.3.0/fastly:object-store/ObjectStore/prototype/get.mdx b/documentation/versioned_docs/version-1.3.0/fastly:object-store/ObjectStore/prototype/get.mdx deleted file mode 100644 index 55eb5ccb28..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:object-store/ObjectStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Object store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Object-store. - -### Return value - -If the key does not exist in the Object store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Object store, this returns a `Promise` which resolves with an `ObjectStoreEntry`. - -## Description - -Send the given message, converted to a string, to this ObjectStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.3.0/fastly:object-store/ObjectStore/prototype/put.mdx b/documentation/versioned_docs/version-1.3.0/fastly:object-store/ObjectStore/prototype/put.mdx deleted file mode 100644 index ca4fd740ea..0000000000 --- a/documentation/versioned_docs/version-1.3.0/fastly:object-store/ObjectStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.put - -The **`put()`** method stores a `value` into the Object store under a `key`. - -> **Note**: Object stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the Object store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the Object store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the Object store. - -## Description - -Stores the supplied `value` into the Object store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-1.3.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/from.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/of.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1659afd87c..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with a implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-1.3.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-1.3.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-1.3.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.3.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-1.3.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.3.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.3.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-1.3.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-1.3.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-1.3.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.3.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-1.3.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-1.3.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-1.3.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-1.3.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-1.3.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-1.3.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.3.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.3.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.3.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/now.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-1.3.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.3.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.3.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-1.3.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-1.3.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-1.3.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-1.3.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-1.3.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-1.3.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.3.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-1.3.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-1.3.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-1.3.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-1.3.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-1.3.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-1.3.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-1.3.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-1.3.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-1.3.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Infinity.mdx b/documentation/versioned_docs/version-1.3.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-1.3.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-1.3.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-1.3.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.3.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-1.3.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-1.3.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-1.3.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-1.3.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-1.3.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/E.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/log.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/max.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/min.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/random.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/round.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-1.3.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/NaN.mdx b/documentation/versioned_docs/version-1.3.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/create.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/is.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Object/values.mdx b/documentation/versioned_docs/version-1.3.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-1.3.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-1.3.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-1.3.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-1.3.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-1.3.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-1.3.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-1.3.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-1.3.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-1.3.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-1.3.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-1.3.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-1.3.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-1.3.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-1.3.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 9c490b51e9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : An property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-1.3.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-1.3.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-1.3.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-1.3.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-1.3.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-1.3.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.3.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-1.3.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-1.3.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-1.3.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-1.3.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-1.3.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-1.3.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-1.3.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-1.3.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-1.3.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.3.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-1.3.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-1.3.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/String.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index 86c60bd0c2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.3.0/globals/String/raw.mdx b/documentation/versioned_docs/version-1.3.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-1.3.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-1.3.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index 2535014e63..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - -## Instance properties - -_This interface doesn't inherit any properties, as it has no parent interface._ - -## Instance methods - -_This interface doesn't inherit any methods, as it has no parent interface._ - -- [`SubtleCrypto.digest()`](./prototype/digest.mdx) - - : Returns a [`Promise`](../Promise/Promise.mdx) that fulfills with a digest generated from the algorithm and text given as parameters. - -## Using SubtleCrypto - -We can split the functions implemented by this API into two groups: cryptography functions and key management functions. - -### Cryptography functions - -These are the functions you can use to implement security features such as privacy and authentication in a system. The `SubtleCrypto` API provides the following cryptography functions: - -- `SubtleCrypto.digest()`: create a fixed-length, collision-resistant digest of some data. diff --git a/documentation/versioned_docs/version-1.3.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-1.3.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 10af5c85e9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-1.3.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-1.3.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-1.3.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-1.3.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-1.3.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-1.3.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-1.3.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.3.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-1.3.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-1.3.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-1.3.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.3.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.3.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.3.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-1.3.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-1.3.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.3.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-1.3.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-1.3.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-1.3.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.3.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-1.3.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.3.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-1.3.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-1.3.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-1.3.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-1.3.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-1.3.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-1.3.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-1.3.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-1.3.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.3.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-1.3.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-1.3.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-1.3.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.3.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-1.3.0/globals/atob.mdx b/documentation/versioned_docs/version-1.3.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-1.3.0/globals/btoa.mdx b/documentation/versioned_docs/version-1.3.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-1.3.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-1.3.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-1.3.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/console/debug.mdx b/documentation/versioned_docs/version-1.3.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/console/error.mdx b/documentation/versioned_docs/version-1.3.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/globals/console/info.mdx b/documentation/versioned_docs/version-1.3.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/console/log.mdx b/documentation/versioned_docs/version-1.3.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/console/warn.mdx b/documentation/versioned_docs/version-1.3.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-1.3.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-1.3.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-1.3.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.3.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-1.3.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-1.3.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-1.3.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-1.3.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-1.3.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-1.3.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-1.3.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/escape.mdx b/documentation/versioned_docs/version-1.3.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-1.3.0/globals/eval.mdx b/documentation/versioned_docs/version-1.3.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-1.3.0/globals/fetch.mdx b/documentation/versioned_docs/version-1.3.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/globalThis.mdx b/documentation/versioned_docs/version-1.3.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-1.3.0/globals/isFinite.mdx b/documentation/versioned_docs/version-1.3.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/isNaN.mdx b/documentation/versioned_docs/version-1.3.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-1.3.0/globals/location.mdx b/documentation/versioned_docs/version-1.3.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-1.3.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-1.3.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-1.3.0/globals/parseInt.mdx b/documentation/versioned_docs/version-1.3.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/setInterval.mdx b/documentation/versioned_docs/version-1.3.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-1.3.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-1.3.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-1.3.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-1.3.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-1.3.0/globals/undefined.mdx b/documentation/versioned_docs/version-1.3.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-1.3.0/globals/unescape.mdx b/documentation/versioned_docs/version-1.3.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-1.3.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-1.3.0/index.mdx b/documentation/versioned_docs/version-1.3.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-1.3.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-1.4.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-1.4.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-1.4.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-1.4.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-1.4.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-1.4.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-1.4.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-1.4.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/fastly:env/env.mdx b/documentation/versioned_docs/version-1.4.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-1.4.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-1.4.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-1.4.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-1.4.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-1.4.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-1.4.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/fastly:object-store/ObjectStore/ObjectStore.mdx b/documentation/versioned_docs/version-1.4.0/fastly:object-store/ObjectStore/ObjectStore.mdx deleted file mode 100644 index 795a52d099..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:object-store/ObjectStore/ObjectStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `ObjectStore()` - -The **`ObjectStore` constructor** lets you connect your Fastly Compute application to a Fastly Object store. - -An object store is a persistent, globally consistent key-value store. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ObjectStore(name) -``` - -> **Note:** `ObjectStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Object store which should be associated with this ObjectStore instance - -### Return value - -A new `ObjectStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Object Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.4.0/fastly:object-store/ObjectStore/prototype/get.mdx b/documentation/versioned_docs/version-1.4.0/fastly:object-store/ObjectStore/prototype/get.mdx deleted file mode 100644 index 55eb5ccb28..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:object-store/ObjectStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Object store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Object-store. - -### Return value - -If the key does not exist in the Object store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Object store, this returns a `Promise` which resolves with an `ObjectStoreEntry`. - -## Description - -Send the given message, converted to a string, to this ObjectStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.4.0/fastly:object-store/ObjectStore/prototype/put.mdx b/documentation/versioned_docs/version-1.4.0/fastly:object-store/ObjectStore/prototype/put.mdx deleted file mode 100644 index ca4fd740ea..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:object-store/ObjectStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.put - -The **`put()`** method stores a `value` into the Object store under a `key`. - -> **Note**: Object stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the Object store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the Object store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the Object store. - -## Description - -Stores the supplied `value` into the Object store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.4.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-1.4.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.4.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-1.4.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.4.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-1.4.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-1.4.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-1.4.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/from.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/of.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1659afd87c..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with a implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-1.4.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-1.4.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-1.4.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.4.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-1.4.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.4.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.4.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-1.4.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-1.4.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-1.4.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.4.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-1.4.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-1.4.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-1.4.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-1.4.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-1.4.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-1.4.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.4.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.4.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.4.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/now.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-1.4.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.4.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.4.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-1.4.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-1.4.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-1.4.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-1.4.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-1.4.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-1.4.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.4.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-1.4.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-1.4.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-1.4.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-1.4.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-1.4.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-1.4.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-1.4.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-1.4.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-1.4.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Infinity.mdx b/documentation/versioned_docs/version-1.4.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-1.4.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-1.4.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-1.4.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.4.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-1.4.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-1.4.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-1.4.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-1.4.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-1.4.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/E.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/log.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/max.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/min.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/random.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/round.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-1.4.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/NaN.mdx b/documentation/versioned_docs/version-1.4.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/create.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/is.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Object/values.mdx b/documentation/versioned_docs/version-1.4.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-1.4.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-1.4.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-1.4.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-1.4.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-1.4.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-1.4.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-1.4.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-1.4.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-1.4.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-1.4.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-1.4.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-1.4.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-1.4.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-1.4.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 9c490b51e9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : An property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-1.4.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-1.4.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-1.4.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-1.4.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-1.4.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-1.4.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.4.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-1.4.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-1.4.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-1.4.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-1.4.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-1.4.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-1.4.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-1.4.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-1.4.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-1.4.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.4.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-1.4.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-1.4.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/String.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index 86c60bd0c2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.4.0/globals/String/raw.mdx b/documentation/versioned_docs/version-1.4.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-1.4.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-1.4.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index 2535014e63..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - -## Instance properties - -_This interface doesn't inherit any properties, as it has no parent interface._ - -## Instance methods - -_This interface doesn't inherit any methods, as it has no parent interface._ - -- [`SubtleCrypto.digest()`](./prototype/digest.mdx) - - : Returns a [`Promise`](../Promise/Promise.mdx) that fulfills with a digest generated from the algorithm and text given as parameters. - -## Using SubtleCrypto - -We can split the functions implemented by this API into two groups: cryptography functions and key management functions. - -### Cryptography functions - -These are the functions you can use to implement security features such as privacy and authentication in a system. The `SubtleCrypto` API provides the following cryptography functions: - -- `SubtleCrypto.digest()`: create a fixed-length, collision-resistant digest of some data. diff --git a/documentation/versioned_docs/version-1.4.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-1.4.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 10af5c85e9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-1.4.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-1.4.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-1.4.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-1.4.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-1.4.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-1.4.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-1.4.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.4.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-1.4.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-1.4.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-1.4.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.4.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.4.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.4.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-1.4.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-1.4.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.4.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-1.4.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-1.4.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-1.4.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.4.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-1.4.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.4.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-1.4.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-1.4.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-1.4.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-1.4.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-1.4.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-1.4.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-1.4.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-1.4.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.4.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-1.4.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-1.4.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-1.4.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.4.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-1.4.0/globals/atob.mdx b/documentation/versioned_docs/version-1.4.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-1.4.0/globals/btoa.mdx b/documentation/versioned_docs/version-1.4.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-1.4.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-1.4.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-1.4.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/console/debug.mdx b/documentation/versioned_docs/version-1.4.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/console/error.mdx b/documentation/versioned_docs/version-1.4.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/globals/console/info.mdx b/documentation/versioned_docs/version-1.4.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/console/log.mdx b/documentation/versioned_docs/version-1.4.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/console/warn.mdx b/documentation/versioned_docs/version-1.4.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-1.4.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-1.4.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-1.4.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.4.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-1.4.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-1.4.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-1.4.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-1.4.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-1.4.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-1.4.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-1.4.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/escape.mdx b/documentation/versioned_docs/version-1.4.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-1.4.0/globals/eval.mdx b/documentation/versioned_docs/version-1.4.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-1.4.0/globals/fetch.mdx b/documentation/versioned_docs/version-1.4.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/globalThis.mdx b/documentation/versioned_docs/version-1.4.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-1.4.0/globals/isFinite.mdx b/documentation/versioned_docs/version-1.4.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/isNaN.mdx b/documentation/versioned_docs/version-1.4.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-1.4.0/globals/location.mdx b/documentation/versioned_docs/version-1.4.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-1.4.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-1.4.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-1.4.0/globals/parseInt.mdx b/documentation/versioned_docs/version-1.4.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/setInterval.mdx b/documentation/versioned_docs/version-1.4.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-1.4.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-1.4.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-1.4.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-1.4.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-1.4.0/globals/undefined.mdx b/documentation/versioned_docs/version-1.4.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-1.4.0/globals/unescape.mdx b/documentation/versioned_docs/version-1.4.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-1.4.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-1.4.0/index.mdx b/documentation/versioned_docs/version-1.4.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-1.4.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-1.5.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-1.5.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-1.5.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-1.5.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-1.5.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-1.5.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-1.5.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-1.5.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/fastly:env/env.mdx b/documentation/versioned_docs/version-1.5.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-1.5.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-1.5.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-1.5.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-1.5.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-1.5.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-1.5.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/fastly:object-store/ObjectStore/ObjectStore.mdx b/documentation/versioned_docs/version-1.5.0/fastly:object-store/ObjectStore/ObjectStore.mdx deleted file mode 100644 index 795a52d099..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:object-store/ObjectStore/ObjectStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `ObjectStore()` - -The **`ObjectStore` constructor** lets you connect your Fastly Compute application to a Fastly Object store. - -An object store is a persistent, globally consistent key-value store. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ObjectStore(name) -``` - -> **Note:** `ObjectStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Object store which should be associated with this ObjectStore instance - -### Return value - -A new `ObjectStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Object Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.5.0/fastly:object-store/ObjectStore/prototype/get.mdx b/documentation/versioned_docs/version-1.5.0/fastly:object-store/ObjectStore/prototype/get.mdx deleted file mode 100644 index 55eb5ccb28..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:object-store/ObjectStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Object store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Object-store. - -### Return value - -If the key does not exist in the Object store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Object store, this returns a `Promise` which resolves with an `ObjectStoreEntry`. - -## Description - -Send the given message, converted to a string, to this ObjectStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.5.0/fastly:object-store/ObjectStore/prototype/put.mdx b/documentation/versioned_docs/version-1.5.0/fastly:object-store/ObjectStore/prototype/put.mdx deleted file mode 100644 index ca4fd740ea..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:object-store/ObjectStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.put - -The **`put()`** method stores a `value` into the Object store under a `key`. - -> **Note**: Object stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the Object store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the Object store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the Object store. - -## Description - -Stores the supplied `value` into the Object store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.5.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-1.5.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.5.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-1.5.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.5.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-1.5.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-1.5.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-1.5.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/from.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/of.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1659afd87c..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with a implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-1.5.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-1.5.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-1.5.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.5.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-1.5.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.5.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.5.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-1.5.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-1.5.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-1.5.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.5.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-1.5.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-1.5.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-1.5.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-1.5.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-1.5.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-1.5.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.5.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.5.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.5.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/now.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-1.5.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.5.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.5.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-1.5.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-1.5.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-1.5.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-1.5.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-1.5.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-1.5.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.5.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-1.5.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-1.5.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-1.5.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-1.5.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-1.5.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-1.5.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-1.5.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-1.5.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-1.5.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Infinity.mdx b/documentation/versioned_docs/version-1.5.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-1.5.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-1.5.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-1.5.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.5.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-1.5.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-1.5.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-1.5.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-1.5.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-1.5.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/E.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/log.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/max.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/min.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/random.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/round.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-1.5.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/NaN.mdx b/documentation/versioned_docs/version-1.5.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/create.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/is.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Object/values.mdx b/documentation/versioned_docs/version-1.5.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-1.5.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-1.5.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-1.5.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-1.5.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-1.5.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-1.5.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-1.5.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-1.5.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-1.5.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-1.5.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-1.5.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-1.5.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-1.5.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-1.5.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 9c490b51e9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : An property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-1.5.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-1.5.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-1.5.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-1.5.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-1.5.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-1.5.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.5.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-1.5.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-1.5.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-1.5.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-1.5.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-1.5.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-1.5.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-1.5.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-1.5.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-1.5.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.5.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-1.5.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-1.5.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/String.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index 86c60bd0c2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.5.0/globals/String/raw.mdx b/documentation/versioned_docs/version-1.5.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-1.5.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-1.5.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index 2535014e63..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - -## Instance properties - -_This interface doesn't inherit any properties, as it has no parent interface._ - -## Instance methods - -_This interface doesn't inherit any methods, as it has no parent interface._ - -- [`SubtleCrypto.digest()`](./prototype/digest.mdx) - - : Returns a [`Promise`](../Promise/Promise.mdx) that fulfills with a digest generated from the algorithm and text given as parameters. - -## Using SubtleCrypto - -We can split the functions implemented by this API into two groups: cryptography functions and key management functions. - -### Cryptography functions - -These are the functions you can use to implement security features such as privacy and authentication in a system. The `SubtleCrypto` API provides the following cryptography functions: - -- `SubtleCrypto.digest()`: create a fixed-length, collision-resistant digest of some data. diff --git a/documentation/versioned_docs/version-1.5.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-1.5.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 10af5c85e9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-1.5.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-1.5.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-1.5.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-1.5.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-1.5.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-1.5.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-1.5.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.5.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-1.5.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-1.5.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-1.5.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.5.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.5.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.5.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-1.5.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-1.5.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.5.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-1.5.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-1.5.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-1.5.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.5.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-1.5.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.5.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-1.5.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-1.5.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-1.5.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-1.5.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-1.5.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-1.5.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-1.5.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-1.5.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.5.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-1.5.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-1.5.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-1.5.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.5.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-1.5.0/globals/atob.mdx b/documentation/versioned_docs/version-1.5.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-1.5.0/globals/btoa.mdx b/documentation/versioned_docs/version-1.5.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-1.5.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-1.5.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-1.5.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/console/debug.mdx b/documentation/versioned_docs/version-1.5.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/console/error.mdx b/documentation/versioned_docs/version-1.5.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/globals/console/info.mdx b/documentation/versioned_docs/version-1.5.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/console/log.mdx b/documentation/versioned_docs/version-1.5.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/console/warn.mdx b/documentation/versioned_docs/version-1.5.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-1.5.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-1.5.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-1.5.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.5.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-1.5.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-1.5.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-1.5.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-1.5.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-1.5.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-1.5.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-1.5.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/escape.mdx b/documentation/versioned_docs/version-1.5.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-1.5.0/globals/eval.mdx b/documentation/versioned_docs/version-1.5.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-1.5.0/globals/fetch.mdx b/documentation/versioned_docs/version-1.5.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/globalThis.mdx b/documentation/versioned_docs/version-1.5.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-1.5.0/globals/isFinite.mdx b/documentation/versioned_docs/version-1.5.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/isNaN.mdx b/documentation/versioned_docs/version-1.5.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-1.5.0/globals/location.mdx b/documentation/versioned_docs/version-1.5.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-1.5.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-1.5.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-1.5.0/globals/parseInt.mdx b/documentation/versioned_docs/version-1.5.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/setInterval.mdx b/documentation/versioned_docs/version-1.5.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-1.5.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-1.5.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-1.5.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-1.5.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-1.5.0/globals/undefined.mdx b/documentation/versioned_docs/version-1.5.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-1.5.0/globals/unescape.mdx b/documentation/versioned_docs/version-1.5.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-1.5.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-1.5.0/index.mdx b/documentation/versioned_docs/version-1.5.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-1.5.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-1.6.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-1.6.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-1.6.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-1.6.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-1.6.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-1.6.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-1.6.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-1.6.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/fastly:env/env.mdx b/documentation/versioned_docs/version-1.6.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-1.6.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-1.6.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-1.6.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-1.6.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-1.6.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-1.6.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/fastly:object-store/ObjectStore/ObjectStore.mdx b/documentation/versioned_docs/version-1.6.0/fastly:object-store/ObjectStore/ObjectStore.mdx deleted file mode 100644 index 795a52d099..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:object-store/ObjectStore/ObjectStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `ObjectStore()` - -The **`ObjectStore` constructor** lets you connect your Fastly Compute application to a Fastly Object store. - -An object store is a persistent, globally consistent key-value store. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ObjectStore(name) -``` - -> **Note:** `ObjectStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Object store which should be associated with this ObjectStore instance - -### Return value - -A new `ObjectStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Object Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.6.0/fastly:object-store/ObjectStore/prototype/get.mdx b/documentation/versioned_docs/version-1.6.0/fastly:object-store/ObjectStore/prototype/get.mdx deleted file mode 100644 index 55eb5ccb28..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:object-store/ObjectStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Object store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Object-store. - -### Return value - -If the key does not exist in the Object store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Object store, this returns a `Promise` which resolves with an `ObjectStoreEntry`. - -## Description - -Send the given message, converted to a string, to this ObjectStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.6.0/fastly:object-store/ObjectStore/prototype/put.mdx b/documentation/versioned_docs/version-1.6.0/fastly:object-store/ObjectStore/prototype/put.mdx deleted file mode 100644 index ca4fd740ea..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:object-store/ObjectStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.put - -The **`put()`** method stores a `value` into the Object store under a `key`. - -> **Note**: Object stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the Object store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the Object store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the Object store. - -## Description - -Stores the supplied `value` into the Object store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.6.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-1.6.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.6.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-1.6.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.6.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-1.6.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-1.6.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-1.6.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/from.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/of.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1659afd87c..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with a implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-1.6.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-1.6.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-1.6.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.6.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-1.6.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.6.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.6.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-1.6.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-1.6.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-1.6.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.6.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-1.6.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-1.6.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-1.6.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-1.6.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-1.6.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-1.6.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.6.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.6.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.6.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/now.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-1.6.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.6.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.6.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-1.6.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-1.6.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-1.6.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-1.6.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-1.6.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-1.6.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.6.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-1.6.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-1.6.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-1.6.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-1.6.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-1.6.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-1.6.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-1.6.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-1.6.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-1.6.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-1.6.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-1.6.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-1.6.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-1.6.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Infinity.mdx b/documentation/versioned_docs/version-1.6.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-1.6.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-1.6.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-1.6.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.6.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-1.6.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-1.6.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-1.6.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-1.6.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-1.6.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/E.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/log.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/max.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/min.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/random.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/round.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-1.6.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/NaN.mdx b/documentation/versioned_docs/version-1.6.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/create.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/is.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Object/values.mdx b/documentation/versioned_docs/version-1.6.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-1.6.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-1.6.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-1.6.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-1.6.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-1.6.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-1.6.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-1.6.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-1.6.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-1.6.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-1.6.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-1.6.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-1.6.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-1.6.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-1.6.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 9c490b51e9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : An property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-1.6.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-1.6.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-1.6.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-1.6.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-1.6.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-1.6.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.6.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-1.6.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-1.6.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-1.6.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-1.6.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-1.6.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-1.6.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-1.6.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-1.6.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-1.6.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.6.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-1.6.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-1.6.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/String.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index 86c60bd0c2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.6.0/globals/String/raw.mdx b/documentation/versioned_docs/version-1.6.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-1.6.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-1.6.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index 2535014e63..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - -## Instance properties - -_This interface doesn't inherit any properties, as it has no parent interface._ - -## Instance methods - -_This interface doesn't inherit any methods, as it has no parent interface._ - -- [`SubtleCrypto.digest()`](./prototype/digest.mdx) - - : Returns a [`Promise`](../Promise/Promise.mdx) that fulfills with a digest generated from the algorithm and text given as parameters. - -## Using SubtleCrypto - -We can split the functions implemented by this API into two groups: cryptography functions and key management functions. - -### Cryptography functions - -These are the functions you can use to implement security features such as privacy and authentication in a system. The `SubtleCrypto` API provides the following cryptography functions: - -- `SubtleCrypto.digest()`: create a fixed-length, collision-resistant digest of some data. diff --git a/documentation/versioned_docs/version-1.6.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-1.6.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 10af5c85e9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-1.6.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-1.6.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-1.6.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-1.6.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-1.6.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-1.6.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-1.6.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.6.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-1.6.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-1.6.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-1.6.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.6.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.6.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.6.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-1.6.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-1.6.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.6.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-1.6.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-1.6.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-1.6.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.6.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-1.6.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.6.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-1.6.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-1.6.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-1.6.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-1.6.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-1.6.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-1.6.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-1.6.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-1.6.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.6.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-1.6.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-1.6.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-1.6.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.6.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-1.6.0/globals/atob.mdx b/documentation/versioned_docs/version-1.6.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-1.6.0/globals/btoa.mdx b/documentation/versioned_docs/version-1.6.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-1.6.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-1.6.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-1.6.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/console/debug.mdx b/documentation/versioned_docs/version-1.6.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/console/error.mdx b/documentation/versioned_docs/version-1.6.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/globals/console/info.mdx b/documentation/versioned_docs/version-1.6.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/console/log.mdx b/documentation/versioned_docs/version-1.6.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/console/warn.mdx b/documentation/versioned_docs/version-1.6.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-1.6.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-1.6.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-1.6.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.6.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-1.6.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-1.6.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-1.6.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-1.6.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-1.6.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-1.6.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-1.6.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/escape.mdx b/documentation/versioned_docs/version-1.6.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-1.6.0/globals/eval.mdx b/documentation/versioned_docs/version-1.6.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-1.6.0/globals/fetch.mdx b/documentation/versioned_docs/version-1.6.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/globalThis.mdx b/documentation/versioned_docs/version-1.6.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-1.6.0/globals/isFinite.mdx b/documentation/versioned_docs/version-1.6.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/isNaN.mdx b/documentation/versioned_docs/version-1.6.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-1.6.0/globals/location.mdx b/documentation/versioned_docs/version-1.6.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-1.6.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-1.6.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-1.6.0/globals/parseInt.mdx b/documentation/versioned_docs/version-1.6.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/setInterval.mdx b/documentation/versioned_docs/version-1.6.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-1.6.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-1.6.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-1.6.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-1.6.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-1.6.0/globals/undefined.mdx b/documentation/versioned_docs/version-1.6.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-1.6.0/globals/unescape.mdx b/documentation/versioned_docs/version-1.6.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-1.6.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-1.6.0/index.mdx b/documentation/versioned_docs/version-1.6.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-1.6.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-1.7.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-1.7.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-1.7.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-1.7.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-1.7.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-1.7.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-1.7.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-1.7.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/fastly:env/env.mdx b/documentation/versioned_docs/version-1.7.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-1.7.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-1.7.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-1.7.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-1.7.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-1.7.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-1.7.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/fastly:object-store/ObjectStore/ObjectStore.mdx b/documentation/versioned_docs/version-1.7.0/fastly:object-store/ObjectStore/ObjectStore.mdx deleted file mode 100644 index beff84fedb..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:object-store/ObjectStore/ObjectStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `ObjectStore()` - -The **`ObjectStore` constructor** lets you connect your Fastly Compute application to a Fastly Object store. - -An object store is a persistent, globally consistent key-value store. See https://developer.fastly.com/learning/concepts/data-stores/#object-stores for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ObjectStore(name) -``` - -> **Note:** `ObjectStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Object store which should be associated with this ObjectStore instance - -### Return value - -A new `ObjectStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Object Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.7.0/fastly:object-store/ObjectStore/prototype/get.mdx b/documentation/versioned_docs/version-1.7.0/fastly:object-store/ObjectStore/prototype/get.mdx deleted file mode 100644 index 55eb5ccb28..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:object-store/ObjectStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Object store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Object-store. - -### Return value - -If the key does not exist in the Object store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Object store, this returns a `Promise` which resolves with an `ObjectStoreEntry`. - -## Description - -Send the given message, converted to a string, to this ObjectStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.7.0/fastly:object-store/ObjectStore/prototype/put.mdx b/documentation/versioned_docs/version-1.7.0/fastly:object-store/ObjectStore/prototype/put.mdx deleted file mode 100644 index ca4fd740ea..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:object-store/ObjectStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.put - -The **`put()`** method stores a `value` into the Object store under a `key`. - -> **Note**: Object stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the Object store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the Object store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the Object store. - -## Description - -Stores the supplied `value` into the Object store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.7.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-1.7.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.7.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-1.7.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.7.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-1.7.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-1.7.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-1.7.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/from.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/of.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-1.7.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-1.7.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-1.7.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.7.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-1.7.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.7.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.7.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-1.7.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-1.7.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-1.7.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.7.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-1.7.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-1.7.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-1.7.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-1.7.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-1.7.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-1.7.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.7.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.7.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.7.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/now.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-1.7.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.7.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.7.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-1.7.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-1.7.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-1.7.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-1.7.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-1.7.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-1.7.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.7.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-1.7.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-1.7.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-1.7.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-1.7.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-1.7.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-1.7.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-1.7.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-1.7.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-1.7.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-1.7.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-1.7.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-1.7.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-1.7.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Infinity.mdx b/documentation/versioned_docs/version-1.7.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-1.7.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-1.7.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-1.7.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.7.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-1.7.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-1.7.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-1.7.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-1.7.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-1.7.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/E.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/log.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/max.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/min.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/random.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/round.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-1.7.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/NaN.mdx b/documentation/versioned_docs/version-1.7.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/create.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/is.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Object/values.mdx b/documentation/versioned_docs/version-1.7.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-1.7.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-1.7.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-1.7.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-1.7.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-1.7.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-1.7.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-1.7.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-1.7.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-1.7.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-1.7.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-1.7.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-1.7.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-1.7.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-1.7.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-1.7.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-1.7.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-1.7.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-1.7.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-1.7.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-1.7.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.7.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-1.7.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-1.7.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-1.7.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-1.7.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-1.7.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-1.7.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-1.7.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-1.7.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-1.7.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.7.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-1.7.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-1.7.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/String.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.7.0/globals/String/raw.mdx b/documentation/versioned_docs/version-1.7.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-1.7.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-1.7.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index 2535014e63..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - -## Instance properties - -_This interface doesn't inherit any properties, as it has no parent interface._ - -## Instance methods - -_This interface doesn't inherit any methods, as it has no parent interface._ - -- [`SubtleCrypto.digest()`](./prototype/digest.mdx) - - : Returns a [`Promise`](../Promise/Promise.mdx) that fulfills with a digest generated from the algorithm and text given as parameters. - -## Using SubtleCrypto - -We can split the functions implemented by this API into two groups: cryptography functions and key management functions. - -### Cryptography functions - -These are the functions you can use to implement security features such as privacy and authentication in a system. The `SubtleCrypto` API provides the following cryptography functions: - -- `SubtleCrypto.digest()`: create a fixed-length, collision-resistant digest of some data. diff --git a/documentation/versioned_docs/version-1.7.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-1.7.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 10af5c85e9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-1.7.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-1.7.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-1.7.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-1.7.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-1.7.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-1.7.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-1.7.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.7.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-1.7.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-1.7.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-1.7.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.7.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.7.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.7.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-1.7.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-1.7.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.7.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-1.7.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-1.7.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-1.7.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.7.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-1.7.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.7.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-1.7.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-1.7.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-1.7.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-1.7.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-1.7.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-1.7.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-1.7.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-1.7.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.7.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-1.7.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-1.7.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-1.7.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.7.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-1.7.0/globals/atob.mdx b/documentation/versioned_docs/version-1.7.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-1.7.0/globals/btoa.mdx b/documentation/versioned_docs/version-1.7.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-1.7.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-1.7.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-1.7.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/console/debug.mdx b/documentation/versioned_docs/version-1.7.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/console/error.mdx b/documentation/versioned_docs/version-1.7.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/globals/console/info.mdx b/documentation/versioned_docs/version-1.7.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/console/log.mdx b/documentation/versioned_docs/version-1.7.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/console/warn.mdx b/documentation/versioned_docs/version-1.7.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-1.7.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-1.7.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-1.7.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.7.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-1.7.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-1.7.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-1.7.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-1.7.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-1.7.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-1.7.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-1.7.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/escape.mdx b/documentation/versioned_docs/version-1.7.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-1.7.0/globals/eval.mdx b/documentation/versioned_docs/version-1.7.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-1.7.0/globals/fetch.mdx b/documentation/versioned_docs/version-1.7.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/globalThis.mdx b/documentation/versioned_docs/version-1.7.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-1.7.0/globals/isFinite.mdx b/documentation/versioned_docs/version-1.7.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/isNaN.mdx b/documentation/versioned_docs/version-1.7.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-1.7.0/globals/location.mdx b/documentation/versioned_docs/version-1.7.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-1.7.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-1.7.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-1.7.0/globals/parseInt.mdx b/documentation/versioned_docs/version-1.7.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/setInterval.mdx b/documentation/versioned_docs/version-1.7.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-1.7.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-1.7.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-1.7.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-1.7.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-1.7.0/globals/undefined.mdx b/documentation/versioned_docs/version-1.7.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-1.7.0/globals/unescape.mdx b/documentation/versioned_docs/version-1.7.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-1.7.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-1.7.0/index.mdx b/documentation/versioned_docs/version-1.7.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-1.7.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-1.8.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-1.8.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-1.8.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-1.8.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-1.8.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-1.8.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-1.8.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-1.8.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/fastly:env/env.mdx b/documentation/versioned_docs/version-1.8.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-1.8.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-1.8.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-1.8.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-1.8.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-1.8.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-1.8.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/fastly:object-store/ObjectStore/ObjectStore.mdx b/documentation/versioned_docs/version-1.8.0/fastly:object-store/ObjectStore/ObjectStore.mdx deleted file mode 100644 index beff84fedb..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:object-store/ObjectStore/ObjectStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `ObjectStore()` - -The **`ObjectStore` constructor** lets you connect your Fastly Compute application to a Fastly Object store. - -An object store is a persistent, globally consistent key-value store. See https://developer.fastly.com/learning/concepts/data-stores/#object-stores for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ObjectStore(name) -``` - -> **Note:** `ObjectStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Object store which should be associated with this ObjectStore instance - -### Return value - -A new `ObjectStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Object Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.8.0/fastly:object-store/ObjectStore/prototype/get.mdx b/documentation/versioned_docs/version-1.8.0/fastly:object-store/ObjectStore/prototype/get.mdx deleted file mode 100644 index 55eb5ccb28..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:object-store/ObjectStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Object store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Object-store. - -### Return value - -If the key does not exist in the Object store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Object store, this returns a `Promise` which resolves with an `ObjectStoreEntry`. - -## Description - -Send the given message, converted to a string, to this ObjectStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.8.0/fastly:object-store/ObjectStore/prototype/put.mdx b/documentation/versioned_docs/version-1.8.0/fastly:object-store/ObjectStore/prototype/put.mdx deleted file mode 100644 index ca4fd740ea..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:object-store/ObjectStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.put - -The **`put()`** method stores a `value` into the Object store under a `key`. - -> **Note**: Object stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the Object store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the Object store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the Object store. - -## Description - -Stores the supplied `value` into the Object store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.8.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-1.8.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.8.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-1.8.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.8.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-1.8.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-1.8.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-1.8.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/from.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/of.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-1.8.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-1.8.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-1.8.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.8.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-1.8.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.8.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.8.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-1.8.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-1.8.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-1.8.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.8.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-1.8.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-1.8.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-1.8.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-1.8.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-1.8.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-1.8.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.8.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.8.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.8.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/now.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-1.8.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.8.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.8.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-1.8.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-1.8.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-1.8.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-1.8.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-1.8.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-1.8.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.8.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-1.8.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-1.8.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-1.8.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-1.8.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-1.8.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-1.8.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-1.8.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-1.8.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-1.8.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-1.8.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-1.8.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-1.8.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-1.8.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Infinity.mdx b/documentation/versioned_docs/version-1.8.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-1.8.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-1.8.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-1.8.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.8.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-1.8.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-1.8.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-1.8.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-1.8.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-1.8.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/E.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/log.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/max.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/min.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/random.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/round.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-1.8.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/NaN.mdx b/documentation/versioned_docs/version-1.8.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/create.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/is.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Object/values.mdx b/documentation/versioned_docs/version-1.8.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-1.8.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-1.8.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-1.8.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-1.8.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-1.8.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-1.8.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-1.8.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-1.8.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-1.8.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-1.8.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-1.8.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-1.8.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-1.8.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-1.8.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-1.8.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-1.8.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-1.8.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-1.8.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-1.8.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-1.8.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.8.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-1.8.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-1.8.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-1.8.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-1.8.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-1.8.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-1.8.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-1.8.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-1.8.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-1.8.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.8.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-1.8.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-1.8.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/String.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.8.0/globals/String/raw.mdx b/documentation/versioned_docs/version-1.8.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-1.8.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-1.8.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index 2535014e63..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - -## Instance properties - -_This interface doesn't inherit any properties, as it has no parent interface._ - -## Instance methods - -_This interface doesn't inherit any methods, as it has no parent interface._ - -- [`SubtleCrypto.digest()`](./prototype/digest.mdx) - - : Returns a [`Promise`](../Promise/Promise.mdx) that fulfills with a digest generated from the algorithm and text given as parameters. - -## Using SubtleCrypto - -We can split the functions implemented by this API into two groups: cryptography functions and key management functions. - -### Cryptography functions - -These are the functions you can use to implement security features such as privacy and authentication in a system. The `SubtleCrypto` API provides the following cryptography functions: - -- `SubtleCrypto.digest()`: create a fixed-length, collision-resistant digest of some data. diff --git a/documentation/versioned_docs/version-1.8.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-1.8.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 10af5c85e9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-1.8.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-1.8.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-1.8.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-1.8.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-1.8.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-1.8.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-1.8.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.8.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-1.8.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-1.8.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-1.8.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.8.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.8.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.8.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-1.8.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-1.8.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.8.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-1.8.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-1.8.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-1.8.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.8.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-1.8.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.8.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-1.8.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-1.8.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-1.8.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-1.8.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-1.8.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-1.8.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-1.8.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-1.8.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.8.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-1.8.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-1.8.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-1.8.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.8.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-1.8.0/globals/atob.mdx b/documentation/versioned_docs/version-1.8.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-1.8.0/globals/btoa.mdx b/documentation/versioned_docs/version-1.8.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-1.8.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-1.8.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-1.8.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/console/debug.mdx b/documentation/versioned_docs/version-1.8.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/console/error.mdx b/documentation/versioned_docs/version-1.8.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/globals/console/info.mdx b/documentation/versioned_docs/version-1.8.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/console/log.mdx b/documentation/versioned_docs/version-1.8.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/console/warn.mdx b/documentation/versioned_docs/version-1.8.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-1.8.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-1.8.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-1.8.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.8.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-1.8.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-1.8.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-1.8.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-1.8.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-1.8.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-1.8.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-1.8.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/escape.mdx b/documentation/versioned_docs/version-1.8.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-1.8.0/globals/eval.mdx b/documentation/versioned_docs/version-1.8.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-1.8.0/globals/fetch.mdx b/documentation/versioned_docs/version-1.8.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/globalThis.mdx b/documentation/versioned_docs/version-1.8.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-1.8.0/globals/isFinite.mdx b/documentation/versioned_docs/version-1.8.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/isNaN.mdx b/documentation/versioned_docs/version-1.8.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-1.8.0/globals/location.mdx b/documentation/versioned_docs/version-1.8.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-1.8.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-1.8.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-1.8.0/globals/parseInt.mdx b/documentation/versioned_docs/version-1.8.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/setInterval.mdx b/documentation/versioned_docs/version-1.8.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-1.8.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-1.8.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-1.8.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-1.8.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-1.8.0/globals/undefined.mdx b/documentation/versioned_docs/version-1.8.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-1.8.0/globals/unescape.mdx b/documentation/versioned_docs/version-1.8.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-1.8.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-1.8.0/index.mdx b/documentation/versioned_docs/version-1.8.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-1.8.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-1.9.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-1.9.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-1.9.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-1.9.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-1.9.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-1.9.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-1.9.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-1.9.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/fastly:env/env.mdx b/documentation/versioned_docs/version-1.9.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-1.9.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-1.9.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-1.9.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-1.9.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-1.9.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-1.9.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/fastly:object-store/ObjectStore/ObjectStore.mdx b/documentation/versioned_docs/version-1.9.0/fastly:object-store/ObjectStore/ObjectStore.mdx deleted file mode 100644 index beff84fedb..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:object-store/ObjectStore/ObjectStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `ObjectStore()` - -The **`ObjectStore` constructor** lets you connect your Fastly Compute application to a Fastly Object store. - -An object store is a persistent, globally consistent key-value store. See https://developer.fastly.com/learning/concepts/data-stores/#object-stores for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ObjectStore(name) -``` - -> **Note:** `ObjectStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Object store which should be associated with this ObjectStore instance - -### Return value - -A new `ObjectStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Object Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.9.0/fastly:object-store/ObjectStore/prototype/get.mdx b/documentation/versioned_docs/version-1.9.0/fastly:object-store/ObjectStore/prototype/get.mdx deleted file mode 100644 index 55eb5ccb28..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:object-store/ObjectStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Object store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Object-store. - -### Return value - -If the key does not exist in the Object store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Object store, this returns a `Promise` which resolves with an `ObjectStoreEntry`. - -## Description - -Send the given message, converted to a string, to this ObjectStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.9.0/fastly:object-store/ObjectStore/prototype/put.mdx b/documentation/versioned_docs/version-1.9.0/fastly:object-store/ObjectStore/prototype/put.mdx deleted file mode 100644 index ca4fd740ea..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:object-store/ObjectStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ObjectStore.prototype.put - -The **`put()`** method stores a `value` into the Object store under a `key`. - -> **Note**: Object stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the Object store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the Object store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the Object store. - -## Description - -Stores the supplied `value` into the Object store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`ObjectStore`](../ObjectStore.mdx) object. - -If the `this` value does not inherit from `ObjectStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an Object Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { ObjectStore } from "fastly:object-store"; - -async function app(event) { - const files = new ObjectStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.9.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-1.9.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.9.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-1.9.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.9.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-1.9.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-1.9.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-1.9.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/from.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/of.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-1.9.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-1.9.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-1.9.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.9.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-1.9.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-1.9.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.9.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-1.9.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-1.9.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-1.9.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.9.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-1.9.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-1.9.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-1.9.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-1.9.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-1.9.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-1.9.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.9.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.9.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.9.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/now.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-1.9.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.9.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.9.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-1.9.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-1.9.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-1.9.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-1.9.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-1.9.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-1.9.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.9.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-1.9.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-1.9.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-1.9.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-1.9.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-1.9.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-1.9.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-1.9.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-1.9.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-1.9.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-1.9.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-1.9.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-1.9.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-1.9.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Infinity.mdx b/documentation/versioned_docs/version-1.9.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-1.9.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-1.9.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-1.9.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.9.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-1.9.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-1.9.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-1.9.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-1.9.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-1.9.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/E.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/log.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/max.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/min.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/random.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/round.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-1.9.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/NaN.mdx b/documentation/versioned_docs/version-1.9.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/create.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/is.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Object/values.mdx b/documentation/versioned_docs/version-1.9.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-1.9.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-1.9.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-1.9.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-1.9.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-1.9.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-1.9.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-1.9.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-1.9.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-1.9.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-1.9.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-1.9.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-1.9.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-1.9.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-1.9.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-1.9.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-1.9.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-1.9.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-1.9.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-1.9.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-1.9.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-1.9.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-1.9.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-1.9.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-1.9.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-1.9.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-1.9.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-1.9.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-1.9.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-1.9.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 6454b50cf1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - > **Warning:** Although you can technically pass `SHA-1` here, this is strongly discouraged as it is considered vulnerable. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-1.9.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-1.9.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/String.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-1.9.0/globals/String/raw.mdx b/documentation/versioned_docs/version-1.9.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 10af5c85e9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 84b2377074..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index 2acf2af4a1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - diff --git a/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index d18b3b1c99..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-1.9.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-1.9.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-1.9.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-1.9.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-1.9.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-1.9.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-1.9.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-1.9.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-1.9.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-1.9.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-1.9.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-1.9.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-1.9.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-1.9.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-1.9.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-1.9.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-1.9.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-1.9.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-1.9.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.9.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-1.9.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-1.9.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-1.9.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-1.9.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-1.9.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-1.9.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-1.9.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-1.9.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-1.9.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-1.9.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-1.9.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-1.9.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-1.9.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-1.9.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-1.9.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-1.9.0/globals/atob.mdx b/documentation/versioned_docs/version-1.9.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-1.9.0/globals/btoa.mdx b/documentation/versioned_docs/version-1.9.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-1.9.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-1.9.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-1.9.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/console/debug.mdx b/documentation/versioned_docs/version-1.9.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/console/error.mdx b/documentation/versioned_docs/version-1.9.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/globals/console/info.mdx b/documentation/versioned_docs/version-1.9.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/console/log.mdx b/documentation/versioned_docs/version-1.9.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/console/warn.mdx b/documentation/versioned_docs/version-1.9.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-1.9.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-1.9.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-1.9.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-1.9.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-1.9.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-1.9.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-1.9.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-1.9.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-1.9.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-1.9.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-1.9.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/escape.mdx b/documentation/versioned_docs/version-1.9.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-1.9.0/globals/eval.mdx b/documentation/versioned_docs/version-1.9.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-1.9.0/globals/fetch.mdx b/documentation/versioned_docs/version-1.9.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/globalThis.mdx b/documentation/versioned_docs/version-1.9.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-1.9.0/globals/isFinite.mdx b/documentation/versioned_docs/version-1.9.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/isNaN.mdx b/documentation/versioned_docs/version-1.9.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-1.9.0/globals/location.mdx b/documentation/versioned_docs/version-1.9.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-1.9.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-1.9.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-1.9.0/globals/parseInt.mdx b/documentation/versioned_docs/version-1.9.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/setInterval.mdx b/documentation/versioned_docs/version-1.9.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-1.9.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-1.9.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-1.9.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-1.9.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-1.9.0/globals/undefined.mdx b/documentation/versioned_docs/version-1.9.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-1.9.0/globals/unescape.mdx b/documentation/versioned_docs/version-1.9.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-1.9.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-1.9.0/index.mdx b/documentation/versioned_docs/version-1.9.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-1.9.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-2.0.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-2.0.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-2.0.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-2.0.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-2.0.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-2.0.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-2.0.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-2.0.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/fastly:env/env.mdx b/documentation/versioned_docs/version-2.0.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-2.0.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-2.0.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-2.0.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-2.0.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-2.0.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-2.0.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index cd63199613..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/kv-stores/#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.0.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-2.0.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-2.0.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-2.0.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.0.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-2.0.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.0.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-2.0.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-2.0.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-2.0.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/from.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/of.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-2.0.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-2.0.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-2.0.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-2.0.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-2.0.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-2.0.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.0.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-2.0.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-2.0.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-2.0.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.0.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-2.0.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-2.0.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-2.0.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-2.0.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-2.0.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-2.0.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-2.0.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.0.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.0.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/now.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-2.0.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.0.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.0.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-2.0.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-2.0.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-2.0.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-2.0.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-2.0.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-2.0.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.0.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-2.0.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-2.0.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-2.0.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-2.0.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-2.0.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-2.0.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-2.0.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-2.0.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-2.0.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-2.0.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-2.0.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-2.0.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-2.0.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Infinity.mdx b/documentation/versioned_docs/version-2.0.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-2.0.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-2.0.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-2.0.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.0.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-2.0.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-2.0.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-2.0.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-2.0.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-2.0.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/E.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/log.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/max.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/min.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/random.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/round.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-2.0.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/NaN.mdx b/documentation/versioned_docs/version-2.0.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/create.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/is.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Object/values.mdx b/documentation/versioned_docs/version-2.0.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-2.0.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-2.0.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-2.0.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-2.0.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-2.0.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-2.0.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-2.0.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-2.0.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-2.0.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-2.0.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-2.0.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-2.0.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-2.0.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-2.0.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-2.0.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-2.0.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-2.0.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-2.0.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-2.0.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-2.0.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.0.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-2.0.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-2.0.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-2.0.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-2.0.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-2.0.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-2.0.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-2.0.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-2.0.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-2.0.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-2.0.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 6454b50cf1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - > **Warning:** Although you can technically pass `SHA-1` here, this is strongly discouraged as it is considered vulnerable. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-2.0.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-2.0.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/String.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.0.0/globals/String/raw.mdx b/documentation/versioned_docs/version-2.0.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 84b2377074..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index 2acf2af4a1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - diff --git a/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index d18b3b1c99..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-2.0.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-2.0.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-2.0.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-2.0.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-2.0.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-2.0.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-2.0.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-2.0.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-2.0.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-2.0.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.0.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.0.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.0.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-2.0.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-2.0.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.0.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-2.0.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-2.0.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-2.0.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.0.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-2.0.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.0.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-2.0.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-2.0.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-2.0.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-2.0.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-2.0.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-2.0.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-2.0.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-2.0.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.0.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-2.0.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-2.0.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-2.0.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-2.0.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-2.0.0/globals/atob.mdx b/documentation/versioned_docs/version-2.0.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-2.0.0/globals/btoa.mdx b/documentation/versioned_docs/version-2.0.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-2.0.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-2.0.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-2.0.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/count.mdx b/documentation/versioned_docs/version-2.0.0/globals/console/count.mdx deleted file mode 100644 index a9287d5b33..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/debug.mdx b/documentation/versioned_docs/version-2.0.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/error.mdx b/documentation/versioned_docs/version-2.0.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/info.mdx b/documentation/versioned_docs/version-2.0.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/log.mdx b/documentation/versioned_docs/version-2.0.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/warn.mdx b/documentation/versioned_docs/version-2.0.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-2.0.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-2.0.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-2.0.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.0.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-2.0.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-2.0.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-2.0.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-2.0.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-2.0.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-2.0.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-2.0.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/escape.mdx b/documentation/versioned_docs/version-2.0.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-2.0.0/globals/eval.mdx b/documentation/versioned_docs/version-2.0.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-2.0.0/globals/fetch.mdx b/documentation/versioned_docs/version-2.0.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/globalThis.mdx b/documentation/versioned_docs/version-2.0.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-2.0.0/globals/isFinite.mdx b/documentation/versioned_docs/version-2.0.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/isNaN.mdx b/documentation/versioned_docs/version-2.0.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-2.0.0/globals/location.mdx b/documentation/versioned_docs/version-2.0.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-2.0.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-2.0.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-2.0.0/globals/parseInt.mdx b/documentation/versioned_docs/version-2.0.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/setInterval.mdx b/documentation/versioned_docs/version-2.0.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-2.0.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-2.0.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-2.0.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-2.0.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-2.0.0/globals/undefined.mdx b/documentation/versioned_docs/version-2.0.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-2.0.0/globals/unescape.mdx b/documentation/versioned_docs/version-2.0.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-2.0.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-2.0.0/index.mdx b/documentation/versioned_docs/version-2.0.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-2.0.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-2.0.0/migration-guide/index.mdx b/documentation/versioned_docs/version-2.0.0/migration-guide/index.mdx deleted file mode 100644 index cce2b54ebd..0000000000 --- a/documentation/versioned_docs/version-2.0.0/migration-guide/index.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-2.1.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-2.1.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-2.1.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index 6b37ba8b5c..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - if (!page) { - page = await render(path); - // Store the page in the cache for 1 minute. - SimpleCache.set(path, page, 60); - } - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/delete.mdx b/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/delete.mdx deleted file mode 100644 index 15f7cfc6c4..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/delete.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.delete - -▸ **delete**(): `string` - -Delete the entry associated with the key `key` from the cache. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `delete` querystring parameter, we delete the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('delete')) { - SimpleCache.delete(path); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.get(path); - if (!page) { - page = await render(path); - // Store the page in the cache for 1 minute. - SimpleCache.set(path, page, 60); - } - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index 3013f820a0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - if (!page) { - page = await render(path); - // Store the page in the cache for 1 minute. - SimpleCache.set(path, page, 60); - } - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/set.mdx b/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/set.mdx deleted file mode 100644 index 97e5f917bd..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCache/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.set - -The **`set()`** method stores an entry into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -set(key, value, ttl) -set(key, value, ttl, length) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied entry under within the cache. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. -- `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. -- `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns `undefined` when the provided `value` has been written into the cache. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - if (!page) { - page = await render(path); - // Store the page in the cache for 1 minute. - SimpleCache.set(path, page, 60); - } - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.1.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-2.1.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-2.1.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-2.1.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-2.1.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:env/env.mdx b/documentation/versioned_docs/version-2.1.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-2.1.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-2.1.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-2.1.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-2.1.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-2.1.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-2.1.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index cd63199613..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/kv-stores/#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-2.1.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-2.1.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-2.1.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.1.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-2.1.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.1.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-2.1.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-2.1.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-2.1.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/from.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/of.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-2.1.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-2.1.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-2.1.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-2.1.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-2.1.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-2.1.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.1.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-2.1.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-2.1.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-2.1.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.1.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-2.1.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-2.1.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-2.1.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-2.1.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-2.1.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-2.1.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-2.1.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.1.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.1.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/now.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-2.1.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.1.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.1.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-2.1.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-2.1.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-2.1.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-2.1.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-2.1.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-2.1.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.1.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-2.1.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-2.1.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-2.1.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-2.1.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-2.1.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-2.1.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-2.1.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-2.1.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-2.1.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-2.1.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-2.1.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-2.1.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-2.1.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Infinity.mdx b/documentation/versioned_docs/version-2.1.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-2.1.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-2.1.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-2.1.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.1.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-2.1.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-2.1.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-2.1.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-2.1.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-2.1.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/E.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/log.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/max.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/min.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/random.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/round.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-2.1.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/NaN.mdx b/documentation/versioned_docs/version-2.1.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/create.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/is.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Object/values.mdx b/documentation/versioned_docs/version-2.1.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-2.1.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-2.1.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-2.1.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-2.1.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-2.1.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-2.1.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-2.1.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-2.1.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-2.1.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-2.1.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-2.1.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-2.1.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-2.1.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-2.1.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-2.1.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-2.1.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-2.1.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-2.1.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-2.1.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-2.1.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.1.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-2.1.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-2.1.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-2.1.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-2.1.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-2.1.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-2.1.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-2.1.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-2.1.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-2.1.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-2.1.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 6454b50cf1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - > **Warning:** Although you can technically pass `SHA-1` here, this is strongly discouraged as it is considered vulnerable. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-2.1.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-2.1.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/String.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.1.0/globals/String/raw.mdx b/documentation/versioned_docs/version-2.1.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 84b2377074..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index 2acf2af4a1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - diff --git a/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index d18b3b1c99..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-2.1.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-2.1.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-2.1.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-2.1.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-2.1.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-2.1.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-2.1.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-2.1.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-2.1.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-2.1.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.1.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.1.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.1.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-2.1.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-2.1.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.1.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-2.1.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-2.1.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-2.1.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.1.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-2.1.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.1.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-2.1.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-2.1.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-2.1.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-2.1.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-2.1.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-2.1.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-2.1.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-2.1.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.1.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-2.1.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-2.1.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-2.1.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-2.1.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-2.1.0/globals/atob.mdx b/documentation/versioned_docs/version-2.1.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-2.1.0/globals/btoa.mdx b/documentation/versioned_docs/version-2.1.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-2.1.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-2.1.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-2.1.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/assert.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/clear.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/count.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/count.mdx deleted file mode 100644 index a9287d5b33..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/debug.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/dir.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/error.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/group.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/info.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/log.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/time.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/trace.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/console/warn.mdx b/documentation/versioned_docs/version-2.1.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-2.1.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-2.1.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-2.1.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.1.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-2.1.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-2.1.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-2.1.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-2.1.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-2.1.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-2.1.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-2.1.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/escape.mdx b/documentation/versioned_docs/version-2.1.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-2.1.0/globals/eval.mdx b/documentation/versioned_docs/version-2.1.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-2.1.0/globals/fetch.mdx b/documentation/versioned_docs/version-2.1.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/globalThis.mdx b/documentation/versioned_docs/version-2.1.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-2.1.0/globals/isFinite.mdx b/documentation/versioned_docs/version-2.1.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/isNaN.mdx b/documentation/versioned_docs/version-2.1.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-2.1.0/globals/location.mdx b/documentation/versioned_docs/version-2.1.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-2.1.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-2.1.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-2.1.0/globals/parseInt.mdx b/documentation/versioned_docs/version-2.1.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/setInterval.mdx b/documentation/versioned_docs/version-2.1.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-2.1.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-2.1.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-2.1.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-2.1.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-2.1.0/globals/undefined.mdx b/documentation/versioned_docs/version-2.1.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-2.1.0/globals/unescape.mdx b/documentation/versioned_docs/version-2.1.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-2.1.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-2.1.0/index.mdx b/documentation/versioned_docs/version-2.1.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-2.1.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-2.1.0/migration-guide/index.mdx b/documentation/versioned_docs/version-2.1.0/migration-guide/index.mdx deleted file mode 100644 index cce2b54ebd..0000000000 --- a/documentation/versioned_docs/version-2.1.0/migration-guide/index.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-2.2.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-2.2.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-2.2.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/delete.mdx b/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/delete.mdx deleted file mode 100644 index 15f7cfc6c4..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/delete.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.delete - -▸ **delete**(): `string` - -Delete the entry associated with the key `key` from the cache. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `delete` querystring parameter, we delete the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('delete')) { - SimpleCache.delete(path); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.get(path); - if (!page) { - page = await render(path); - // Store the page in the cache for 1 minute. - SimpleCache.set(path, page, 60); - } - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index 3013f820a0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - if (!page) { - page = await render(path); - // Store the page in the cache for 1 minute. - SimpleCache.set(path, page, 60); - } - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index a15a22dc09..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key` if no entry is found (or has expired), the supplied `set` function is executed and it's result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - : A function to execute when the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. - - `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/set.mdx b/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/set.mdx deleted file mode 100644 index 97e5f917bd..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.set - -The **`set()`** method stores an entry into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -set(key, value, ttl) -set(key, value, ttl, length) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied entry under within the cache. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. -- `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. -- `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns `undefined` when the provided `value` has been written into the cache. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - if (!page) { - page = await render(path); - // Store the page in the cache for 1 minute. - SimpleCache.set(path, page, 60); - } - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-2.2.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-2.2.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-2.2.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-2.2.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-2.2.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:env/env.mdx b/documentation/versioned_docs/version-2.2.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-2.2.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-2.2.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-2.2.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-2.2.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-2.2.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-2.2.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index cd63199613..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/kv-stores/#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-2.2.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-2.2.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-2.2.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.2.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-2.2.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.2.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-2.2.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-2.2.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-2.2.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/from.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/of.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-2.2.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-2.2.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-2.2.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-2.2.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-2.2.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-2.2.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.2.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-2.2.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-2.2.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-2.2.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.2.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-2.2.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-2.2.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-2.2.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-2.2.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-2.2.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-2.2.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-2.2.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.2.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.2.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/now.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-2.2.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.2.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.2.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-2.2.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-2.2.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-2.2.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-2.2.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-2.2.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-2.2.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.2.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-2.2.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-2.2.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-2.2.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-2.2.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-2.2.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-2.2.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-2.2.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-2.2.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-2.2.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-2.2.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-2.2.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-2.2.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-2.2.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Infinity.mdx b/documentation/versioned_docs/version-2.2.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-2.2.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-2.2.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-2.2.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.2.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-2.2.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-2.2.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-2.2.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-2.2.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-2.2.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/E.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/log.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/max.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/min.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/random.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/round.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-2.2.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/NaN.mdx b/documentation/versioned_docs/version-2.2.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/create.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/is.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Object/values.mdx b/documentation/versioned_docs/version-2.2.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-2.2.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-2.2.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-2.2.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-2.2.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-2.2.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-2.2.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-2.2.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-2.2.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-2.2.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-2.2.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-2.2.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-2.2.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-2.2.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-2.2.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-2.2.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-2.2.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-2.2.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-2.2.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-2.2.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-2.2.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.2.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-2.2.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-2.2.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-2.2.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-2.2.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-2.2.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-2.2.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-2.2.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-2.2.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-2.2.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-2.2.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 6454b50cf1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - > **Warning:** Although you can technically pass `SHA-1` here, this is strongly discouraged as it is considered vulnerable. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-2.2.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-2.2.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/String.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.2.0/globals/String/raw.mdx b/documentation/versioned_docs/version-2.2.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 84b2377074..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index 2acf2af4a1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - diff --git a/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index d18b3b1c99..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-2.2.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-2.2.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-2.2.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-2.2.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-2.2.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-2.2.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-2.2.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-2.2.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-2.2.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-2.2.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.2.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.2.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.2.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-2.2.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-2.2.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.2.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-2.2.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-2.2.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-2.2.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.2.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-2.2.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.2.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-2.2.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-2.2.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-2.2.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-2.2.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-2.2.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-2.2.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-2.2.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-2.2.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.2.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-2.2.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-2.2.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-2.2.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-2.2.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-2.2.0/globals/atob.mdx b/documentation/versioned_docs/version-2.2.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-2.2.0/globals/btoa.mdx b/documentation/versioned_docs/version-2.2.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-2.2.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-2.2.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-2.2.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/assert.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/clear.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/count.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/count.mdx deleted file mode 100644 index a9287d5b33..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/debug.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/dir.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/error.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/group.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/info.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/log.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/time.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/trace.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/console/warn.mdx b/documentation/versioned_docs/version-2.2.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-2.2.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-2.2.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-2.2.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.2.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-2.2.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-2.2.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-2.2.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-2.2.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-2.2.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-2.2.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-2.2.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/escape.mdx b/documentation/versioned_docs/version-2.2.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-2.2.0/globals/eval.mdx b/documentation/versioned_docs/version-2.2.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-2.2.0/globals/fetch.mdx b/documentation/versioned_docs/version-2.2.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/globalThis.mdx b/documentation/versioned_docs/version-2.2.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-2.2.0/globals/isFinite.mdx b/documentation/versioned_docs/version-2.2.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/isNaN.mdx b/documentation/versioned_docs/version-2.2.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-2.2.0/globals/location.mdx b/documentation/versioned_docs/version-2.2.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-2.2.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-2.2.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-2.2.0/globals/parseInt.mdx b/documentation/versioned_docs/version-2.2.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/setInterval.mdx b/documentation/versioned_docs/version-2.2.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-2.2.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-2.2.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-2.2.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-2.2.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-2.2.0/globals/undefined.mdx b/documentation/versioned_docs/version-2.2.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-2.2.0/globals/unescape.mdx b/documentation/versioned_docs/version-2.2.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-2.2.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-2.2.0/index.mdx b/documentation/versioned_docs/version-2.2.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-2.2.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-2.2.0/migration-guide/index.mdx b/documentation/versioned_docs/version-2.2.0/migration-guide/index.mdx deleted file mode 100644 index cce2b54ebd..0000000000 --- a/documentation/versioned_docs/version-2.2.0/migration-guide/index.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-2.3.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-2.3.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-2.3.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/delete.mdx b/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/delete.mdx deleted file mode 100644 index 15f7cfc6c4..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/delete.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.delete - -▸ **delete**(): `string` - -Delete the entry associated with the key `key` from the cache. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `delete` querystring parameter, we delete the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('delete')) { - SimpleCache.delete(path); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.get(path); - if (!page) { - page = await render(path); - // Store the page in the cache for 1 minute. - SimpleCache.set(path, page, 60); - } - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index 3013f820a0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - if (!page) { - page = await render(path); - // Store the page in the cache for 1 minute. - SimpleCache.set(path, page, 60); - } - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index a15a22dc09..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key` if no entry is found (or has expired), the supplied `set` function is executed and it's result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - : A function to execute when the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. - - `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/set.mdx b/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/set.mdx deleted file mode 100644 index 97e5f917bd..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCache/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.set - -The **`set()`** method stores an entry into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -set(key, value, ttl) -set(key, value, ttl, length) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied entry under within the cache. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. -- `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. -- `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns `undefined` when the provided `value` has been written into the cache. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - if (!page) { - page = await render(path); - // Store the page in the cache for 1 minute. - SimpleCache.set(path, page, 60); - } - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-2.3.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-2.3.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-2.3.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-2.3.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-2.3.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:env/env.mdx b/documentation/versioned_docs/version-2.3.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-2.3.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-2.3.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-2.3.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-2.3.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-2.3.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-2.3.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index cd63199613..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/kv-stores/#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-2.3.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-2.3.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-2.3.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.3.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-2.3.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.3.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-2.3.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-2.3.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-2.3.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/from.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/of.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-2.3.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-2.3.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-2.3.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-2.3.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-2.3.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-2.3.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.3.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-2.3.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-2.3.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-2.3.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.3.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-2.3.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-2.3.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-2.3.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-2.3.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-2.3.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-2.3.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-2.3.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.3.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.3.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/now.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-2.3.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.3.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.3.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-2.3.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-2.3.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-2.3.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-2.3.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-2.3.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-2.3.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.3.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-2.3.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-2.3.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-2.3.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-2.3.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-2.3.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-2.3.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-2.3.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-2.3.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-2.3.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-2.3.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-2.3.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-2.3.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-2.3.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Infinity.mdx b/documentation/versioned_docs/version-2.3.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-2.3.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-2.3.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-2.3.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.3.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-2.3.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-2.3.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-2.3.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-2.3.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-2.3.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/E.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/log.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/max.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/min.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/random.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/round.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-2.3.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/NaN.mdx b/documentation/versioned_docs/version-2.3.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/create.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/is.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Object/values.mdx b/documentation/versioned_docs/version-2.3.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-2.3.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-2.3.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-2.3.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-2.3.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-2.3.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-2.3.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-2.3.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-2.3.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-2.3.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-2.3.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-2.3.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-2.3.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-2.3.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-2.3.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-2.3.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-2.3.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-2.3.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-2.3.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-2.3.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-2.3.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.3.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-2.3.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-2.3.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-2.3.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-2.3.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-2.3.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-2.3.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-2.3.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-2.3.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-2.3.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-2.3.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 6454b50cf1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - > **Warning:** Although you can technically pass `SHA-1` here, this is strongly discouraged as it is considered vulnerable. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-2.3.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-2.3.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/String.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.3.0/globals/String/raw.mdx b/documentation/versioned_docs/version-2.3.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 84b2377074..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index 2acf2af4a1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - diff --git a/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index d18b3b1c99..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-2.3.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-2.3.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-2.3.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-2.3.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-2.3.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-2.3.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-2.3.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-2.3.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-2.3.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-2.3.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.3.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.3.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.3.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-2.3.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-2.3.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.3.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-2.3.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-2.3.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-2.3.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.3.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-2.3.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.3.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-2.3.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-2.3.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-2.3.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-2.3.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-2.3.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-2.3.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-2.3.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-2.3.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.3.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-2.3.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-2.3.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-2.3.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-2.3.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-2.3.0/globals/atob.mdx b/documentation/versioned_docs/version-2.3.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-2.3.0/globals/btoa.mdx b/documentation/versioned_docs/version-2.3.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-2.3.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-2.3.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-2.3.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/assert.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/clear.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/count.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/count.mdx deleted file mode 100644 index a9287d5b33..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/debug.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/dir.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/error.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/group.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/info.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/log.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/time.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/trace.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/console/warn.mdx b/documentation/versioned_docs/version-2.3.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-2.3.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-2.3.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-2.3.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.3.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-2.3.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-2.3.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-2.3.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-2.3.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-2.3.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-2.3.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-2.3.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/escape.mdx b/documentation/versioned_docs/version-2.3.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-2.3.0/globals/eval.mdx b/documentation/versioned_docs/version-2.3.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-2.3.0/globals/fetch.mdx b/documentation/versioned_docs/version-2.3.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/globalThis.mdx b/documentation/versioned_docs/version-2.3.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-2.3.0/globals/isFinite.mdx b/documentation/versioned_docs/version-2.3.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/isNaN.mdx b/documentation/versioned_docs/version-2.3.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-2.3.0/globals/location.mdx b/documentation/versioned_docs/version-2.3.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-2.3.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-2.3.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-2.3.0/globals/parseInt.mdx b/documentation/versioned_docs/version-2.3.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/setInterval.mdx b/documentation/versioned_docs/version-2.3.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-2.3.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-2.3.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-2.3.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-2.3.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-2.3.0/globals/undefined.mdx b/documentation/versioned_docs/version-2.3.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-2.3.0/globals/unescape.mdx b/documentation/versioned_docs/version-2.3.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-2.3.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-2.3.0/index.mdx b/documentation/versioned_docs/version-2.3.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-2.3.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-2.3.0/migration-guide/index.mdx b/documentation/versioned_docs/version-2.3.0/migration-guide/index.mdx deleted file mode 100644 index cce2b54ebd..0000000000 --- a/documentation/versioned_docs/version-2.3.0/migration-guide/index.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-2.4.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-2.4.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-2.4.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/delete.mdx b/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/delete.mdx deleted file mode 100644 index 15f7cfc6c4..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/delete.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.delete - -▸ **delete**(): `string` - -Delete the entry associated with the key `key` from the cache. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `delete` querystring parameter, we delete the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('delete')) { - SimpleCache.delete(path); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.get(path); - if (!page) { - page = await render(path); - // Store the page in the cache for 1 minute. - SimpleCache.set(path, page, 60); - } - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index 3013f820a0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - if (!page) { - page = await render(path); - // Store the page in the cache for 1 minute. - SimpleCache.set(path, page, 60); - } - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index a15a22dc09..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key` if no entry is found (or has expired), the supplied `set` function is executed and it's result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - : A function to execute when the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. - - `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/set.mdx b/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/set.mdx deleted file mode 100644 index 97e5f917bd..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCache/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.set - -The **`set()`** method stores an entry into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -set(key, value, ttl) -set(key, value, ttl, length) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied entry under within the cache. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. -- `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. -- `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns `undefined` when the provided `value` has been written into the cache. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - if (!page) { - page = await render(path); - // Store the page in the cache for 1 minute. - SimpleCache.set(path, page, 60); - } - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-2.4.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-2.4.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-2.4.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-2.4.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-2.4.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:env/env.mdx b/documentation/versioned_docs/version-2.4.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-2.4.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-2.4.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-2.4.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-2.4.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-2.4.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-2.4.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index cd63199613..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/kv-stores/#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-2.4.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-2.4.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-2.4.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.4.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-2.4.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.4.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-2.4.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-2.4.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-2.4.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/from.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/of.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-2.4.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-2.4.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-2.4.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-2.4.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-2.4.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-2.4.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.4.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-2.4.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-2.4.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-2.4.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.4.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-2.4.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-2.4.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-2.4.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-2.4.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-2.4.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-2.4.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-2.4.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.4.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.4.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/now.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-2.4.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.4.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.4.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-2.4.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-2.4.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-2.4.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-2.4.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-2.4.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-2.4.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.4.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-2.4.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-2.4.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-2.4.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-2.4.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-2.4.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-2.4.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-2.4.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-2.4.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-2.4.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-2.4.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-2.4.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-2.4.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-2.4.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Infinity.mdx b/documentation/versioned_docs/version-2.4.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-2.4.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-2.4.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-2.4.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.4.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-2.4.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-2.4.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-2.4.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-2.4.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-2.4.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/E.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/log.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/max.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/min.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/random.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/round.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-2.4.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/NaN.mdx b/documentation/versioned_docs/version-2.4.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/create.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/is.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Object/values.mdx b/documentation/versioned_docs/version-2.4.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-2.4.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-2.4.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-2.4.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-2.4.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-2.4.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-2.4.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-2.4.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-2.4.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-2.4.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-2.4.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-2.4.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-2.4.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-2.4.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-2.4.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-2.4.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-2.4.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-2.4.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-2.4.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-2.4.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-2.4.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-2.4.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-2.4.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-2.4.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-2.4.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-2.4.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-2.4.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-2.4.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-2.4.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-2.4.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-2.4.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-2.4.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 6454b50cf1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - > **Warning:** Although you can technically pass `SHA-1` here, this is strongly discouraged as it is considered vulnerable. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-2.4.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-2.4.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/String.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-2.4.0/globals/String/raw.mdx b/documentation/versioned_docs/version-2.4.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 84b2377074..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index 2acf2af4a1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - diff --git a/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index d18b3b1c99..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-2.4.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-2.4.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-2.4.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-2.4.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-2.4.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-2.4.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-2.4.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-2.4.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-2.4.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-2.4.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-2.4.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-2.4.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-2.4.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-2.4.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-2.4.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-2.4.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-2.4.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-2.4.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-2.4.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.4.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-2.4.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-2.4.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-2.4.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-2.4.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-2.4.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-2.4.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-2.4.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-2.4.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-2.4.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-2.4.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-2.4.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-2.4.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-2.4.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-2.4.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-2.4.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-2.4.0/globals/atob.mdx b/documentation/versioned_docs/version-2.4.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-2.4.0/globals/btoa.mdx b/documentation/versioned_docs/version-2.4.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-2.4.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-2.4.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-2.4.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/assert.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/clear.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/count.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/count.mdx deleted file mode 100644 index a9287d5b33..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/debug.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/dir.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/error.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/group.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/info.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/log.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/time.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/trace.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/console/warn.mdx b/documentation/versioned_docs/version-2.4.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-2.4.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-2.4.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-2.4.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-2.4.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-2.4.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-2.4.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-2.4.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-2.4.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-2.4.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-2.4.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/escape.mdx b/documentation/versioned_docs/version-2.4.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-2.4.0/globals/eval.mdx b/documentation/versioned_docs/version-2.4.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-2.4.0/globals/fetch.mdx b/documentation/versioned_docs/version-2.4.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/globalThis.mdx b/documentation/versioned_docs/version-2.4.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-2.4.0/globals/isFinite.mdx b/documentation/versioned_docs/version-2.4.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/isNaN.mdx b/documentation/versioned_docs/version-2.4.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-2.4.0/globals/location.mdx b/documentation/versioned_docs/version-2.4.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-2.4.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-2.4.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-2.4.0/globals/parseInt.mdx b/documentation/versioned_docs/version-2.4.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/performance/now.mdx b/documentation/versioned_docs/version-2.4.0/globals/performance/now.mdx deleted file mode 100644 index da8f617cb9..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/performance/now.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.now() - -The **`performance.now()`** method returns a high resolution timestamp in milliseconds. -It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated). - -## Syntax - -```js -now() -``` - -### Parameters - -None. - -### Return value - -Returns a number which represents the time since worker instantation measured in milliseconds. diff --git a/documentation/versioned_docs/version-2.4.0/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-2.4.0/globals/performance/timeOrigin.mdx deleted file mode 100644 index 772a527822..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/performance/timeOrigin.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.timeOrigin - -The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps. - -This value represents the time when the worker was instantiated. - -### Value - -Returns a number which represents the time when the worker was instantation. \ No newline at end of file diff --git a/documentation/versioned_docs/version-2.4.0/globals/setInterval.mdx b/documentation/versioned_docs/version-2.4.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-2.4.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-2.4.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-2.4.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-2.4.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-2.4.0/globals/undefined.mdx b/documentation/versioned_docs/version-2.4.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-2.4.0/globals/unescape.mdx b/documentation/versioned_docs/version-2.4.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-2.4.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-2.4.0/index.mdx b/documentation/versioned_docs/version-2.4.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-2.4.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-2.4.0/migration-guide/index.mdx b/documentation/versioned_docs/version-2.4.0/migration-guide/index.mdx deleted file mode 100644 index cce2b54ebd..0000000000 --- a/documentation/versioned_docs/version-2.4.0/migration-guide/index.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-3.0.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index 2ef3585189..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,221 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-3.0.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-3.0.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index 8803456915..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, and return a message stating whether the entry was in the Fastly Cache or not. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - return new Response(page ? `${path} is in the cache` : `${path} is not in the cache`, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index a15a22dc09..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key` if no entry is found (or has expired), the supplied `set` function is executed and it's result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - : A function to execute when the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. - - `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-3.0.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-3.0.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-3.0.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-3.0.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-3.0.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:env/env.mdx b/documentation/versioned_docs/version-3.0.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.0.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-3.0.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-3.0.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-3.0.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-3.0.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-3.0.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index cd63199613..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/kv-stores/#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-3.0.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-3.0.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-3.0.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.0.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-3.0.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.0.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-3.0.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-3.0.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-3.0.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/from.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/of.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-3.0.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-3.0.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-3.0.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.0.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-3.0.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.0.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.0.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-3.0.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-3.0.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-3.0.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.0.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-3.0.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-3.0.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-3.0.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-3.0.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-3.0.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-3.0.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.0.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.0.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.0.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/now.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-3.0.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.0.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.0.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-3.0.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-3.0.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-3.0.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-3.0.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-3.0.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-3.0.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.0.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-3.0.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-3.0.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-3.0.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-3.0.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-3.0.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-3.0.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-3.0.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-3.0.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-3.0.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-3.0.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-3.0.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-3.0.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-3.0.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Infinity.mdx b/documentation/versioned_docs/version-3.0.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-3.0.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-3.0.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-3.0.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.0.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-3.0.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-3.0.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-3.0.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-3.0.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-3.0.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/E.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/log.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/max.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/min.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/random.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/round.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-3.0.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/NaN.mdx b/documentation/versioned_docs/version-3.0.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/create.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/is.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Object/values.mdx b/documentation/versioned_docs/version-3.0.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-3.0.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-3.0.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-3.0.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-3.0.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-3.0.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-3.0.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-3.0.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-3.0.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-3.0.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-3.0.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-3.0.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-3.0.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-3.0.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-3.0.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-3.0.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-3.0.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-3.0.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-3.0.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-3.0.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-3.0.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.0.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-3.0.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-3.0.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-3.0.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-3.0.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-3.0.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-3.0.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-3.0.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-3.0.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-3.0.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-3.0.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/String.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.0.0/globals/String/raw.mdx b/documentation/versioned_docs/version-3.0.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 1e17f6d925..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `raw`: [Raw](#raw) format. - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. - - For HMAC: - Pass an [`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - -### Raw - -You can use this format to import or export AES or HMAC secret keys, or Elliptic Curve -public keys. - -In this format the key is supplied as an `ArrayBuffer` containing the raw bytes for the key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-3.0.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-3.0.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-3.0.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-3.0.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-3.0.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-3.0.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-3.0.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.0.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-3.0.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-3.0.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.0.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.0.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.0.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-3.0.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-3.0.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.0.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-3.0.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-3.0.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-3.0.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.0.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-3.0.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.0.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-3.0.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-3.0.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-3.0.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-3.0.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-3.0.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-3.0.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-3.0.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-3.0.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.0.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-3.0.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-3.0.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-3.0.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.0.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-3.0.0/globals/atob.mdx b/documentation/versioned_docs/version-3.0.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-3.0.0/globals/btoa.mdx b/documentation/versioned_docs/version-3.0.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-3.0.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-3.0.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-3.0.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/assert.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/clear.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/debug.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/dir.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/error.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/group.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/info.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/log.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/time.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/trace.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/warn.mdx b/documentation/versioned_docs/version-3.0.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-3.0.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-3.0.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-3.0.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-3.0.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-3.0.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-3.0.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-3.0.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-3.0.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-3.0.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-3.0.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/escape.mdx b/documentation/versioned_docs/version-3.0.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-3.0.0/globals/eval.mdx b/documentation/versioned_docs/version-3.0.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-3.0.0/globals/fetch.mdx b/documentation/versioned_docs/version-3.0.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/globalThis.mdx b/documentation/versioned_docs/version-3.0.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-3.0.0/globals/isFinite.mdx b/documentation/versioned_docs/version-3.0.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/isNaN.mdx b/documentation/versioned_docs/version-3.0.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-3.0.0/globals/location.mdx b/documentation/versioned_docs/version-3.0.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-3.0.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-3.0.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-3.0.0/globals/parseInt.mdx b/documentation/versioned_docs/version-3.0.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/performance/now.mdx b/documentation/versioned_docs/version-3.0.0/globals/performance/now.mdx deleted file mode 100644 index da8f617cb9..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/performance/now.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.now() - -The **`performance.now()`** method returns a high resolution timestamp in milliseconds. -It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated). - -## Syntax - -```js -now() -``` - -### Parameters - -None. - -### Return value - -Returns a number which represents the time since worker instantation measured in milliseconds. diff --git a/documentation/versioned_docs/version-3.0.0/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-3.0.0/globals/performance/timeOrigin.mdx deleted file mode 100644 index 772a527822..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/performance/timeOrigin.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.timeOrigin - -The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps. - -This value represents the time when the worker was instantiated. - -### Value - -Returns a number which represents the time when the worker was instantation. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.0.0/globals/setInterval.mdx b/documentation/versioned_docs/version-3.0.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-3.0.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-3.0.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-3.0.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-3.0.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-3.0.0/globals/undefined.mdx b/documentation/versioned_docs/version-3.0.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-3.0.0/globals/unescape.mdx b/documentation/versioned_docs/version-3.0.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-3.0.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-3.0.0/index.mdx b/documentation/versioned_docs/version-3.0.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-3.0.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-3.1.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-3.1.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index fffeca92b7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,227 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `dontPool` _: boolean_ _**optional**_ - - Determine whether or not connections to the same backend should be pooled across different sessions. - - Fastly considers two backends “the same” if they're registered with the same name and the exact same settings. - - In those cases, when pooling is enabled, if Session 1 opens a connection to this backend it will be left open, and can be re-used by Session 2. - - This can help improve backend latency, by removing the need for the initial network / TLS handshake(s). - - By default, pooling is enabled for dynamic backends. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-3.1.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-3.1.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index 8803456915..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, and return a message stating whether the entry was in the Fastly Cache or not. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - return new Response(page ? `${path} is in the cache` : `${path} is not in the cache`, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index a15a22dc09..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key` if no entry is found (or has expired), the supplied `set` function is executed and it's result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - : A function to execute when the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. - - `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/purge.mdx b/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/purge.mdx deleted file mode 100644 index 44ac6ff92c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCache/purge.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# SimpleCache.purge - -purge the entry associated with the key `key` from the cache. - -## Syntax - -```js -purge(key, options) -``` - -### Parameters - -- `key` _: string_ - - The key to purge from within the cache. - -- `options` _: object_ - - `scope` _: string_ - - : Where to purge the content from. - - Possible values are: - - "global" - This will remove the content from all of Fastly. - - "pop" - This will remove the content from the POP that contains the currently executing instance. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `purge` querystring parameter, we purge the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('purge')) { - SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-3.1.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-3.1.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-3.1.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-3.1.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-3.1.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:env/env.mdx b/documentation/versioned_docs/version-3.1.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.1.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-3.1.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-3.1.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-3.1.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-3.1.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-3.1.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index cd63199613..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/kv-stores/#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-3.1.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-3.1.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-3.1.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.1.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-3.1.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.1.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-3.1.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-3.1.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-3.1.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/from.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/of.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-3.1.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-3.1.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-3.1.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.1.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-3.1.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.1.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.1.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-3.1.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-3.1.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-3.1.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.1.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-3.1.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-3.1.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-3.1.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-3.1.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-3.1.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-3.1.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.1.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.1.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.1.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DOMException/DOMException.mdx b/documentation/versioned_docs/version-3.1.0/globals/DOMException/DOMException.mdx deleted file mode 100644 index 160e40e774..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DOMException/DOMException.mdx +++ /dev/null @@ -1,107 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException() - -The **`DOMException()`** constructor returns a `DOMException` object with a specified message and name. - -## Syntax - -```js -new DOMException() -new DOMException(message) -new DOMException(message, name) -``` - -### Parameters - -- `message` _optional_ - - : A description of the exception. If not present, the empty string `''` is - used. -- `name` _optional_ - - : A string. If the specified name is a [standard error name](#error-names), then getting the [`code`](./code.mdx) property of the `DOMException` object will return the code number corresponding to the specified name. - -### Return value - -A newly created `DOMException` object. - -## Error names - -Common error names are listed here. Some APIs define their own sets of names, so this is not necessarily a complete list. - -Note that the following deprecated historical errors don't have an error name but instead have only a legacy constant code value and a legacy constant name: - -- Legacy code value: `2`, legacy constant name: `DOMSTRING_SIZE_ERR` -- Legacy code value: `6`, legacy constant name: `NO_DATA_ALLOWED_ERR` -- Legacy code value: `16`, legacy constant name: `VALIDATION_ERR` - -> **Note:** Because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past. - -- `IndexSizeError` - - : The index is not in the allowed range. (Legacy code value: `1` and legacy constant name: `INDEX_SIZE_ERR`) -- `HierarchyRequestError` - - : The node tree hierarchy is not correct. (Legacy code value: `3` and legacy constant name: `HIERARCHY_REQUEST_ERR`) -- `WrongDocumentError` - - : The object is in the wrong `Document`. (Legacy code value: `4` and legacy constant name: `WRONG_DOCUMENT_ERR`) -- `InvalidCharacterError` - - : The string contains invalid characters. (Legacy code value: `5` and legacy constant name: `INVALID_CHARACTER_ERR`) -- `NoModificationAllowedError` - - : The object cannot be modified. (Legacy code value: `7` and legacy constant name: `NO_MODIFICATION_ALLOWED_ERR`) -- `NotFoundError` - - : The object cannot be found here. (Legacy code value: `8` and legacy constant name: `NOT_FOUND_ERR`) -- `NotSupportedError` - - : The operation is not supported. (Legacy code value: `9` and legacy constant name: `NOT_SUPPORTED_ERR`) -- `InvalidStateError` - - : The object is in an invalid state. (Legacy code value: `11` and legacy constant name: `INVALID_STATE_ERR`) -- `InUseAttributeError` - - : The attribute is in use. (Legacy code value: `10` and legacy constant name: `INUSE_ATTRIBUTE_ERR`) -- `SyntaxError` - - : The string did not match the expected pattern. (Legacy code value: `12` and legacy constant name: `SYNTAX_ERR`) -- `InvalidModificationError` - - : The object cannot be modified in this way. (Legacy code value: `13` and legacy constant name: `INVALID_MODIFICATION_ERR`) -- `NamespaceError` - - : The operation is not allowed by Namespaces in XML. (Legacy code value: `14` and legacy constant name: `NAMESPACE_ERR`) -- `InvalidAccessError` - - : The object does not support the operation or argument. (Legacy code value: `15` and legacy constant name: `INVALID_ACCESS_ERR`) -- `TypeMismatchError` *deprecated* - - : The type of the object does not match the expected type. (Legacy code value: `17` and legacy constant name: `TYPE_MISMATCH_ERR`) This value is deprecated; the JavaScript `TypeError` exception is now raised instead of a `DOMException` with this value. -- `SecurityError` - - : The operation is insecure. (Legacy code value: `18` and legacy constant name: `SECURITY_ERR`) -- `NetworkError` - - : A network error occurred. (Legacy code value: `19` and legacy constant name: `NETWORK_ERR`) -- `AbortError` - - : The operation was aborted. (Legacy code value: `20` and legacy constant name: `ABORT_ERR`) -- `URLMismatchError` - - : The given URL does not match another URL. (Legacy code value: `21` and legacy constant name: `URL_MISMATCH_ERR`) -- `QuotaExceededError` - - : The quota has been exceeded. (Legacy code value: `22` and legacy constant name: `QUOTA_EXCEEDED_ERR`) -- `TimeoutError` - - : The operation timed out. (Legacy code value: `23` and legacy constant name: `TIMEOUT_ERR`) -- `InvalidNodeTypeError` - - : The node is incorrect or has an incorrect ancestor for this operation. (Legacy code value: `24` and legacy constant name: `INVALID_NODE_TYPE_ERR`) -- `DataCloneError` - - : The object can not be cloned. (Legacy code value: `25` and legacy constant name: `DATA_CLONE_ERR`) -- `EncodingError` - - : The encoding or decoding operation failed (No legacy code value and constant name). -- `NotReadableError` - - : The input/output read operation failed (No legacy code value and constant name). -- `UnknownError` - - : The operation failed for an unknown transient reason (e.g. out of memory) (No legacy code value and constant name). -- `ConstraintError` - - : A mutation operation in a transaction failed because a constraint was not satisfied (No legacy code value and constant name). -- `DataError` - - : Provided data is inadequate (No legacy code value and constant name). -- `TransactionInactiveError` - - : A request was placed against a transaction that is currently not active or is finished (No legacy code value and constant name). -- `ReadOnlyError` - - : The mutating operation was attempted in a "readonly" transaction (No legacy code value and constant name). -- `VersionError` - - : An attempt was made to open a database using a lower version than the existing version (No legacy code value and constant name). -- `OperationError` - - : The operation failed for an operation-specific reason (No legacy code value and constant name). -- `NotAllowedError` - - : The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (No legacy code value and constant name). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/globals/DOMException/code.mdx b/documentation/versioned_docs/version-3.1.0/globals/DOMException/code.mdx deleted file mode 100644 index 21b9836fa4..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DOMException/code.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.code - -The **`code`** read-only property of the `DOMException` interface returns one of the legacy [error code constants](./DOMException.mdx#error-names), or `0` if none match. - -This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the [`name`](./name.mdx) attribute. - -## Value - -One of the [error code constants](./DOMException.mdx#error-names), or `0` if none match. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DOMException/message.mdx b/documentation/versioned_docs/version-3.1.0/globals/DOMException/message.mdx deleted file mode 100644 index 44d3c6b8da..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DOMException/message.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.message - -The **`message`** read-only property of the `DOMException` interface returns a string representing a message or description associated with the given [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DOMException/name.mdx b/documentation/versioned_docs/version-3.1.0/globals/DOMException/name.mdx deleted file mode 100644 index 1dda11b92c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DOMException/name.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.name - -The **`name`** read-only property of the `DOMException` interface returns a string that contains one of the strings associated with an [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/now.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-3.1.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.1.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.1.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-3.1.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-3.1.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-3.1.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-3.1.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-3.1.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-3.1.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.1.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-3.1.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-3.1.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-3.1.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-3.1.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-3.1.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-3.1.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-3.1.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-3.1.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-3.1.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-3.1.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-3.1.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-3.1.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-3.1.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.1.0/globals/HmacImportParams/HmacImportParams.mdx b/documentation/versioned_docs/version-3.1.0/globals/HmacImportParams/HmacImportParams.mdx deleted file mode 100644 index 816aa2e7dc..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/HmacImportParams/HmacImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# HmacImportParams - -The **`HmacImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey`, when generating a key for the `HMAC` algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `HMAC`. -- `hash` - - - : A string representing the name of the digest function to use. The can take a value of `SHA-1`, `SHA-256`, `SHA-384`, or `SHA-512`. - -- `length` _optional_ - - : A `Number` representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/Infinity.mdx b/documentation/versioned_docs/version-3.1.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-3.1.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-3.1.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-3.1.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.1.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-3.1.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-3.1.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-3.1.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-3.1.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-3.1.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/E.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/log.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/max.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/min.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/random.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/round.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-3.1.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/NaN.mdx b/documentation/versioned_docs/version-3.1.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/create.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/is.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Object/values.mdx b/documentation/versioned_docs/version-3.1.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-3.1.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-3.1.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-3.1.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-3.1.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-3.1.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-3.1.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-3.1.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-3.1.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-3.1.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-3.1.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-3.1.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-3.1.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-3.1.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-3.1.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-3.1.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-3.1.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-3.1.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-3.1.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-3.1.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-3.1.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.1.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-3.1.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-3.1.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-3.1.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-3.1.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-3.1.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-3.1.0/globals/Request/Request.mdx deleted file mode 100644 index 93507fc0e2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Request/Request.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-3.1.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-3.1.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-3.1.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-3.1.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 3477966947..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-3.1.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-3.1.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/String.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.1.0/globals/String/raw.mdx b/documentation/versioned_docs/version-3.1.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 1e17f6d925..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `raw`: [Raw](#raw) format. - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. - - For HMAC: - Pass an [`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - -### Raw - -You can use this format to import or export AES or HMAC secret keys, or Elliptic Curve -public keys. - -In this format the key is supplied as an `ArrayBuffer` containing the raw bytes for the key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index c7cdac8c62..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use [HMAC](#hmac), pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - -### HMAC - -The HMAC algorithm calculates and verifies hash-based message authentication codes according to the -[FIPS 198-1 standard](https://csrc.nist.gov/csrc/media/publications/fips/198/1/final/documents/fips-198-1_final.pdf). - -The digest algorithm to use is specified in the -[`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object -that you pass into [`SubtleCrypto.importKey()`](./importKey.mdx). diff --git a/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index df9d338369..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use HMAC, pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-3.1.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-3.1.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-3.1.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-3.1.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-3.1.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-3.1.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-3.1.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.1.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-3.1.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-3.1.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.1.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.1.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.1.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-3.1.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-3.1.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.1.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-3.1.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-3.1.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-3.1.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.1.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-3.1.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.1.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-3.1.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-3.1.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-3.1.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-3.1.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-3.1.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-3.1.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-3.1.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-3.1.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.1.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-3.1.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-3.1.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-3.1.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.1.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-3.1.0/globals/atob.mdx b/documentation/versioned_docs/version-3.1.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-3.1.0/globals/btoa.mdx b/documentation/versioned_docs/version-3.1.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-3.1.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-3.1.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-3.1.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/assert.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/clear.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/count.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/count.mdx deleted file mode 100644 index ea8b92a0d4..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` _optional_ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/debug.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/dir.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/error.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/group.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/info.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/log.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/time.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/trace.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/console/warn.mdx b/documentation/versioned_docs/version-3.1.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-3.1.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-3.1.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-3.1.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-3.1.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-3.1.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-3.1.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-3.1.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-3.1.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-3.1.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-3.1.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/escape.mdx b/documentation/versioned_docs/version-3.1.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-3.1.0/globals/eval.mdx b/documentation/versioned_docs/version-3.1.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-3.1.0/globals/fetch.mdx b/documentation/versioned_docs/version-3.1.0/globals/fetch.mdx deleted file mode 100644 index b31481ac93..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/fetch.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/globalThis.mdx b/documentation/versioned_docs/version-3.1.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-3.1.0/globals/isFinite.mdx b/documentation/versioned_docs/version-3.1.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/isNaN.mdx b/documentation/versioned_docs/version-3.1.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-3.1.0/globals/location.mdx b/documentation/versioned_docs/version-3.1.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-3.1.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-3.1.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-3.1.0/globals/parseInt.mdx b/documentation/versioned_docs/version-3.1.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/performance/now.mdx b/documentation/versioned_docs/version-3.1.0/globals/performance/now.mdx deleted file mode 100644 index da8f617cb9..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/performance/now.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.now() - -The **`performance.now()`** method returns a high resolution timestamp in milliseconds. -It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated). - -## Syntax - -```js -now() -``` - -### Parameters - -None. - -### Return value - -Returns a number which represents the time since worker instantation measured in milliseconds. diff --git a/documentation/versioned_docs/version-3.1.0/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-3.1.0/globals/performance/timeOrigin.mdx deleted file mode 100644 index 772a527822..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/performance/timeOrigin.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.timeOrigin - -The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps. - -This value represents the time when the worker was instantiated. - -### Value - -Returns a number which represents the time when the worker was instantation. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.1.0/globals/setInterval.mdx b/documentation/versioned_docs/version-3.1.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-3.1.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-3.1.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-3.1.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-3.1.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-3.1.0/globals/undefined.mdx b/documentation/versioned_docs/version-3.1.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-3.1.0/globals/unescape.mdx b/documentation/versioned_docs/version-3.1.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-3.1.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-3.1.0/index.mdx b/documentation/versioned_docs/version-3.1.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-3.1.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-3.1.0/migration-guide/index.mdx b/documentation/versioned_docs/version-3.1.0/migration-guide/index.mdx deleted file mode 100644 index 543d0432cd..0000000000 --- a/documentation/versioned_docs/version-3.1.0/migration-guide/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# `Migrating from v2 to v3` - -## SimpleCache.delete renamed to SimpleCache.purge and requires purge options to be supplied as the second parameter - -We are renaming because "purge" is already a well-known and documented concept for removing content from Fastly's cache. - -The new addition of a second argument allows the caller to decide what scope to purge the content from, currently they can choose to purge from all of Fastly ("global") or from the POP that contains the currently executing instance ("pop"). We do not provide a default option right now, in the future we may provide a default option, if we discover a common pattern is being used. - -Here is an example of migrating an application using `SimpleCache.delete` to `SimpleCache.purge` with the same purging behaviour: -```diff -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request); - const path = url.pathname; - if (url.searchParams.has('delete')) { -- SimpleCache.delete(path); -+ SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - - -``` - - -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-3.10.0/fastly:backend/Backend/Backend.mdx similarity index 100% rename from documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/Backend.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:backend/Backend/Backend.mdx diff --git a/documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/exists.mdx b/documentation/versioned_docs/version-3.10.0/fastly:backend/Backend/exists.mdx similarity index 100% rename from documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/exists.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:backend/Backend/exists.mdx diff --git a/documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/fromName.mdx b/documentation/versioned_docs/version-3.10.0/fastly:backend/Backend/fromName.mdx similarity index 100% rename from documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/fromName.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:backend/Backend/fromName.mdx diff --git a/documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/health.mdx b/documentation/versioned_docs/version-3.10.0/fastly:backend/Backend/health.mdx similarity index 100% rename from documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/health.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:backend/Backend/health.mdx diff --git a/documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/prototype/toName.mdx b/documentation/versioned_docs/version-3.10.0/fastly:backend/Backend/prototype/toName.mdx similarity index 100% rename from documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/prototype/toName.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:backend/Backend/prototype/toName.mdx diff --git a/documentation/versioned_docs/version-1.1.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-3.10.0/fastly:backend/Backend/prototype/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/fastly:backend/Backend/prototype/toString.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:backend/Backend/prototype/toString.mdx diff --git a/documentation/versioned_docs/version-1.1.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache-override/CacheOverride/CacheOverride.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/fastly:cache-override/CacheOverride/CacheOverride.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache-override/CacheOverride/CacheOverride.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/age.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/age.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/age.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/age.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/body.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/body.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/body.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/body.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/close.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/close.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/close.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/close.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/hits.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/hits.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/hits.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/hits.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/length.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/length.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/length.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/length.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/maxAge.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/maxAge.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/maxAge.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/maxAge.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/staleWhileRevalidate.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/staleWhileRevalidate.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/staleWhileRevalidate.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/staleWhileRevalidate.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/state.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/state.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/state.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/state.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/userMetadata.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/userMetadata.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CacheEntry/userMetadata.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CacheEntry/userMetadata.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CacheState/found.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CacheState/found.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CacheState/found.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CacheState/found.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CacheState/mustInsertOrUpdate.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CacheState/mustInsertOrUpdate.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CacheState/mustInsertOrUpdate.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CacheState/mustInsertOrUpdate.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CacheState/stale.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CacheState/stale.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CacheState/stale.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CacheState/stale.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CacheState/usable.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CacheState/usable.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CacheState/usable.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CacheState/usable.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CoreCache/insert.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CoreCache/insert.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CoreCache/insert.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CoreCache/insert.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CoreCache/lookup.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CoreCache/lookup.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CoreCache/lookup.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CoreCache/lookup.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/CoreCache/transactionLookup.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/CoreCache/transactionLookup.mdx similarity index 98% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/CoreCache/transactionLookup.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/CoreCache/transactionLookup.mdx index ef8ab1dda7..b6d1bfbcd2 100644 --- a/documentation/versioned_docs/version-3.9.0/fastly:cache/CoreCache/transactionLookup.mdx +++ b/documentation/versioned_docs/version-3.10.0/fastly:cache/CoreCache/transactionLookup.mdx @@ -5,7 +5,7 @@ pagination_next: null pagination_prev: null --- -# CoreCache.lookup +# CoreCache.transactionLookup Perform a transactional lookup into the cache, returning a `TransactionCacheEntry` instance. diff --git a/documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCache/SimpleCache.mdx similarity index 100% rename from documentation/versioned_docs/version-2.2.0/fastly:cache/SimpleCache/SimpleCache.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCache/SimpleCache.mdx diff --git a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCache/get.mdx similarity index 100% rename from documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/get.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCache/get.mdx diff --git a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCache/getOrSet.mdx similarity index 100% rename from documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/getOrSet.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCache/getOrSet.mdx diff --git a/documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/purge.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCache/purge.mdx similarity index 100% rename from documentation/versioned_docs/version-3.0.0/fastly:cache/SimpleCache/purge.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCache/purge.mdx diff --git a/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx similarity index 100% rename from documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx diff --git a/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCacheEntry/body.mdx similarity index 100% rename from documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCacheEntry/body.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCacheEntry/body.mdx diff --git a/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx similarity index 100% rename from documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx diff --git a/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCacheEntry/json.mdx similarity index 100% rename from documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCacheEntry/json.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCacheEntry/json.mdx diff --git a/documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCacheEntry/text.mdx similarity index 100% rename from documentation/versioned_docs/version-2.1.0/fastly:cache/SimpleCacheEntry/text.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/SimpleCacheEntry/text.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/age.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/age.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/age.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/age.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/body.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/body.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/body.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/body.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/cancel.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/cancel.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/cancel.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/cancel.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/close.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/close.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/close.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/close.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/hits.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/hits.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/hits.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/hits.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/insert.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/insert.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/insert.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/insert.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/insertAndStreamBack.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/insertAndStreamBack.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/insertAndStreamBack.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/insertAndStreamBack.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/length.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/length.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/length.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/length.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/maxAge.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/maxAge.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/maxAge.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/maxAge.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/staleWhileRevalidate.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/staleWhileRevalidate.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/staleWhileRevalidate.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/staleWhileRevalidate.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/state.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/state.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/state.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/state.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/update.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/update.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/update.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/update.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/userMetadata.mdx b/documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/userMetadata.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:cache/TransactionCacheEntry/userMetadata.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:cache/TransactionCacheEntry/userMetadata.mdx diff --git a/documentation/versioned_docs/version-1.1.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-3.10.0/fastly:config-store/ConfigStore/ConfigStore.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/fastly:config-store/ConfigStore/ConfigStore.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:config-store/ConfigStore/ConfigStore.mdx diff --git a/documentation/versioned_docs/version-1.1.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-3.10.0/fastly:config-store/ConfigStore/prototype/get.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/fastly:config-store/ConfigStore/prototype/get.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:config-store/ConfigStore/prototype/get.mdx diff --git a/documentation/versioned_docs/version-3.10.0/fastly:device/Device/lookup.mdx b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/lookup.mdx new file mode 100644 index 0000000000..71db040fc9 --- /dev/null +++ b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/lookup.mdx @@ -0,0 +1,22 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- + +# Device.lookup() + +Look up the data associated with a particular User-Agent string. + + +## Syntax + +```js +lookup(userAgent) +``` + +### Return value + +If there is data associated with the User-Agent, a `Device` instance is returned. +Otherwise, `null` is returned. diff --git a/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/brand.mdx b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/brand.mdx new file mode 100644 index 0000000000..0212b64fff --- /dev/null +++ b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/brand.mdx @@ -0,0 +1,16 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.brand + +The read-only **`brand`** property of the `Device` interface is +either a string stating the brand of the device, which can be different from the manufacturer of that device. +If no brand is known, the value will be `null`. + + +## Value + +Either a string value if a brand is known, otherwise `null`. diff --git a/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/hardwareType.mdx b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/hardwareType.mdx new file mode 100644 index 0000000000..dc383215f5 --- /dev/null +++ b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/hardwareType.mdx @@ -0,0 +1,18 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.hardwareType + +The read-only **`hardwareType`** property of the `Device` interface is +either a string stating the hardware type of the device, or `null` if the hardware type is not known. + +A string representation of the device's primary platform hardware. The most commonly used device types are also identified via boolean variables. Because a device may have multiple device types and this variable only has the primary type, we recommend using the boolean variables for logic and using this string representation for logging. + + + +## Value + +Either a string value if a hardware type is known, otherwise `null`. diff --git a/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isDesktop.mdx b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isDesktop.mdx new file mode 100644 index 0000000000..f5993762ce --- /dev/null +++ b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isDesktop.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isDesktop + +The read-only **`isDesktop`** property of the `Device` interface is +either a boolean stating if the device is a desktop web browser, or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device is a desktop web browser, or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isGameConsole.mdx b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isGameConsole.mdx new file mode 100644 index 0000000000..839735ae4a --- /dev/null +++ b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isGameConsole.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isGameConsole + +The read-only **`isGameConsole`** property of the `Device` interface is +either a boolean stating if the device is a video game console, or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device is a video game console, or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isMediaPlayer.mdx b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isMediaPlayer.mdx new file mode 100644 index 0000000000..391c5dc168 --- /dev/null +++ b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isMediaPlayer.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isMediaPlayer + +The read-only **`isMediaPlayer`** property of the `Device` interface is +either a boolean stating if the device is a media player (like Blu-ray players, iPod devices, and smart speakers such as Amazon Echo), or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device is a media player (like Blu-ray players, iPod devices, and smart speakers such as Amazon Echo), or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isMobile.mdx b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isMobile.mdx new file mode 100644 index 0000000000..507ed050fc --- /dev/null +++ b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isMobile.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isMobile + +The read-only **`isMobile`** property of the `Device` interface is +either a boolean stating if the device is a mobile phone, or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device is a mobile phone, or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isSmartTV.mdx b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isSmartTV.mdx new file mode 100644 index 0000000000..9619f66473 --- /dev/null +++ b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isSmartTV.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isSmartTV + +The read-only **`isSmartTV`** property of the `Device` interface is +either a boolean stating if the device is a smart TV, or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device is a smart TV, or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isTablet.mdx b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isTablet.mdx new file mode 100644 index 0000000000..429a1cceb9 --- /dev/null +++ b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isTablet.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isTablet + +The read-only **`isTablet`** property of the `Device` interface is +either a boolean stating if the device is a tablet (like an iPad), or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device is a tablet (like an iPad), or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isTouchscreen.mdx b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isTouchscreen.mdx new file mode 100644 index 0000000000..3c951c2b76 --- /dev/null +++ b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/isTouchscreen.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.isTouchscreen + +The read-only **`isTouchscreen`** property of the `Device` interface is +either a boolean stating if the device's screen is touch sensitive, or `null` if the this is not known. + + +## Value + +Either a boolean stating if the device's screen is touch sensitive, or `null` if the this is not known. diff --git a/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/model.mdx b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/model.mdx new file mode 100644 index 0000000000..782c9cef60 --- /dev/null +++ b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/model.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.model + +The read-only **`model`** property of the `Device` interface is +either a string stating the model of the device, or `null` if the model is not known. + + +## Value + +Either a string value if a model is known, otherwise `null`. diff --git a/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/name.mdx b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/name.mdx new file mode 100644 index 0000000000..468c436c21 --- /dev/null +++ b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/name.mdx @@ -0,0 +1,15 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +# Device.prototype.name + +The read-only **`name`** property of the `Device` interface is +either a string stating the name of the device, or `null` if the name is not known. + + +## Value + +Either a string value if a name is known, otherwise `null`. diff --git a/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/toJSON.mdx new file mode 100644 index 0000000000..505c2e1734 --- /dev/null +++ b/documentation/versioned_docs/version-3.10.0/fastly:device/Device/prototype/toJSON.mdx @@ -0,0 +1,24 @@ +--- +hide_title: false +hide_table_of_contents: false +pagination_next: null +pagination_prev: null +--- +import {Fiddle} from '@site/src/components/fiddle'; + +# toJSON + +The `toJSON()` method of the Device interface is a serializer; +it returns a JSON representation of the Device object. + +To get a JSON string, you can use `JSON.stringify(device)` directly; it will call `toJSON()` automatically. + +## Syntax + +```js +toJSON() +``` + +### Return value + +A JSON object that is the serialization of the Device object. diff --git a/documentation/versioned_docs/version-1.1.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-3.10.0/fastly:dictionary/Dictionary/Dictionary.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/fastly:dictionary/Dictionary/Dictionary.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:dictionary/Dictionary/Dictionary.mdx diff --git a/documentation/versioned_docs/version-1.1.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-3.10.0/fastly:dictionary/Dictionary/prototype/get.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/fastly:dictionary/Dictionary/prototype/get.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:dictionary/Dictionary/prototype/get.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/EdgeRateLimiter/EdgeRateLimiter.mdx b/documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/EdgeRateLimiter/EdgeRateLimiter.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/EdgeRateLimiter/EdgeRateLimiter.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/EdgeRateLimiter/EdgeRateLimiter.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/EdgeRateLimiter/prototype/checkRate.mdx b/documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/EdgeRateLimiter/prototype/checkRate.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/EdgeRateLimiter/prototype/checkRate.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/EdgeRateLimiter/prototype/checkRate.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/PenaltyBox/PenaltyBox.mdx b/documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/PenaltyBox/PenaltyBox.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/PenaltyBox/PenaltyBox.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/PenaltyBox/PenaltyBox.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/PenaltyBox/prototype/add.mdx b/documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/PenaltyBox/prototype/add.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/PenaltyBox/prototype/add.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/PenaltyBox/prototype/add.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/PenaltyBox/prototype/has.mdx b/documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/PenaltyBox/prototype/has.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/PenaltyBox/prototype/has.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/PenaltyBox/prototype/has.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/RateCounter/RateCounter.mdx b/documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/RateCounter/RateCounter.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/RateCounter/RateCounter.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/RateCounter/RateCounter.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/RateCounter/prototype/increment.mdx b/documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/RateCounter/prototype/increment.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/RateCounter/prototype/increment.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/RateCounter/prototype/increment.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/RateCounter/prototype/lookupCount.mdx b/documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/RateCounter/prototype/lookupCount.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/RateCounter/prototype/lookupCount.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/RateCounter/prototype/lookupCount.mdx diff --git a/documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/RateCounter/prototype/lookupRate.mdx b/documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/RateCounter/prototype/lookupRate.mdx similarity index 100% rename from documentation/versioned_docs/version-3.9.0/fastly:edge-rate-limiter/RateCounter/prototype/lookupRate.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:edge-rate-limiter/RateCounter/prototype/lookupRate.mdx diff --git a/documentation/versioned_docs/version-1.1.0/fastly:env/env.mdx b/documentation/versioned_docs/version-3.10.0/fastly:env/env.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/fastly:env/env.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:env/env.mdx diff --git a/documentation/versioned_docs/version-1.1.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.10.0/fastly:experimental/allowDynamicBackends.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/fastly:experimental/allowDynamicBackends.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:experimental/allowDynamicBackends.mdx diff --git a/documentation/versioned_docs/version-1.1.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-3.10.0/fastly:experimental/includeBytes.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/fastly:experimental/includeBytes.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:experimental/includeBytes.mdx diff --git a/documentation/versioned_docs/version-1.12.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-3.10.0/fastly:fanout/createFanoutHandoff.mdx similarity index 100% rename from documentation/versioned_docs/version-1.12.0/fastly:fanout/createFanoutHandoff.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:fanout/createFanoutHandoff.mdx diff --git a/documentation/versioned_docs/version-1.1.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-3.10.0/fastly:geolocation/getGeolocationForIpAddress.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/fastly:geolocation/getGeolocationForIpAddress.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:geolocation/getGeolocationForIpAddress.mdx diff --git a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStore/KVStore.mdx similarity index 100% rename from documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStore/KVStore.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStore/KVStore.mdx diff --git a/documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStore/prototype/get.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStore/prototype/get.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStore/prototype/get.mdx diff --git a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStore/prototype/put.mdx similarity index 100% rename from documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStore/prototype/put.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStore/prototype/put.mdx diff --git a/documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx diff --git a/documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx diff --git a/documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx diff --git a/documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx diff --git a/documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx diff --git a/documentation/versioned_docs/version-1.1.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-3.10.0/fastly:logger/Logger/Logger.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/fastly:logger/Logger/Logger.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:logger/Logger/Logger.mdx diff --git a/documentation/versioned_docs/version-1.1.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-3.10.0/fastly:logger/Logger/prototype/log.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/fastly:logger/Logger/prototype/log.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:logger/Logger/prototype/log.mdx diff --git a/documentation/versioned_docs/version-1.10.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-3.10.0/fastly:secret-store/SecretStore/SecretStore.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/fastly:secret-store/SecretStore/SecretStore.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:secret-store/SecretStore/SecretStore.mdx diff --git a/documentation/versioned_docs/version-1.10.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-3.10.0/fastly:secret-store/SecretStore/prototype/get.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/fastly:secret-store/SecretStore/prototype/get.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:secret-store/SecretStore/prototype/get.mdx diff --git a/documentation/versioned_docs/version-1.10.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-3.10.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx rename to documentation/versioned_docs/version-3.10.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-3.10.0/globals/AggregrateError/AggregrateError.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/AggregrateError/AggregrateError.mdx rename to documentation/versioned_docs/version-3.10.0/globals/AggregrateError/AggregrateError.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/@@species.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/@@species.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/@@species.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/Array.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/Array.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/Array.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/from.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/from.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/from.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/from.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/isArray.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/isArray.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/isArray.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/of.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/of.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/of.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/of.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/@@iterator.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/@@iterator.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/@@iterator.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/@@unscopables.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/@@unscopables.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/@@unscopables.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/at.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/at.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/at.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/concat.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/concat.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/concat.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/copyWithin.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/copyWithin.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/copyWithin.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/entries.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/entries.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/entries.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/every.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/every.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/every.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/fill.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/fill.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/fill.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/filter.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/filter.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/filter.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/find.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/find.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/find.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/findIndex.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/findIndex.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/findIndex.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/flat.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/flat.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/flat.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/flatMap.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/flatMap.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/flatMap.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/forEach.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/forEach.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/forEach.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/includes.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/includes.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/includes.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/indexOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/indexOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/indexOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/join.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/join.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/join.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/keys.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/keys.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/keys.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/lastIndexOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/lastIndexOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/lastIndexOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/length.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/length.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/length.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/map.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/map.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/map.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/pop.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/pop.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/pop.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/push.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/push.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/push.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/reduce.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/reduce.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/reduce.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/reduceRight.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/reduceRight.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/reduceRight.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/reverse.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/reverse.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/reverse.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/shift.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/shift.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/shift.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/slice.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/slice.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/slice.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/some.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/some.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/some.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/sort.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/sort.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/sort.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/splice.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/splice.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/splice.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/toLocaleString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/Array/prototype/toLocaleString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/toLocaleString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/toString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/toString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/unshift.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/unshift.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/unshift.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-3.10.0/globals/Array/prototype/values.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Array/prototype/values.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Array/prototype/values.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-3.10.0/globals/ArrayBuffer/@@species.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ArrayBuffer/@@species.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ArrayBuffer/@@species.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-3.10.0/globals/ArrayBuffer/ArrayBuffer.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ArrayBuffer/ArrayBuffer.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ArrayBuffer/ArrayBuffer.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-3.10.0/globals/ArrayBuffer/isView.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ArrayBuffer/isView.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ArrayBuffer/isView.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.10.0/globals/ArrayBuffer/prototype/byteLength.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ArrayBuffer/prototype/byteLength.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ArrayBuffer/prototype/byteLength.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-3.10.0/globals/ArrayBuffer/prototype/slice.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ArrayBuffer/prototype/slice.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ArrayBuffer/prototype/slice.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-3.10.0/globals/BigInt/BigInt.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/BigInt/BigInt.mdx rename to documentation/versioned_docs/version-3.10.0/globals/BigInt/BigInt.mdx diff --git a/documentation/versioned_docs/version-1.1.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-3.10.0/globals/BigInt/asIntN.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/globals/BigInt/asIntN.mdx rename to documentation/versioned_docs/version-3.10.0/globals/BigInt/asIntN.mdx diff --git a/documentation/versioned_docs/version-1.1.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-3.10.0/globals/BigInt/asUintN.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/globals/BigInt/asUintN.mdx rename to documentation/versioned_docs/version-3.10.0/globals/BigInt/asUintN.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.10.0/globals/BigInt/prototype/toLocaleString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/BigInt/prototype/toLocaleString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/BigInt/prototype/toLocaleString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-3.10.0/globals/BigInt/prototype/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/BigInt/prototype/toString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/BigInt/prototype/toString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/BigInt/prototype/valueOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/BigInt/prototype/valueOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/BigInt/prototype/valueOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-3.10.0/globals/BigInt64Array/BigInt64Array.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/BigInt64Array/BigInt64Array.mdx rename to documentation/versioned_docs/version-3.10.0/globals/BigInt64Array/BigInt64Array.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-3.10.0/globals/BigUint64Array/BigUint64Array.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/BigUint64Array/BigUint64Array.mdx rename to documentation/versioned_docs/version-3.10.0/globals/BigUint64Array/BigUint64Array.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-3.10.0/globals/Boolean/Boolean.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Boolean/Boolean.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Boolean/Boolean.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Boolean/prototype/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Boolean/prototype/toString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Boolean/prototype/toString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Boolean/prototype/valueOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Boolean/prototype/valueOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Boolean/prototype/valueOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-3.10.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-3.10.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-3.10.0/globals/CompressionStream/CompressionStream.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/CompressionStream/CompressionStream.mdx rename to documentation/versioned_docs/version-3.10.0/globals/CompressionStream/CompressionStream.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.10.0/globals/CompressionStream/prototype/readable.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/CompressionStream/prototype/readable.mdx rename to documentation/versioned_docs/version-3.10.0/globals/CompressionStream/prototype/readable.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.10.0/globals/CompressionStream/prototype/writable.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/CompressionStream/prototype/writable.mdx rename to documentation/versioned_docs/version-3.10.0/globals/CompressionStream/prototype/writable.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-3.10.0/globals/CryptoKey/CryptoKey.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/CryptoKey/CryptoKey.mdx rename to documentation/versioned_docs/version-3.10.0/globals/CryptoKey/CryptoKey.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-3.10.0/globals/CryptoKey/prototype/algorithm.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/CryptoKey/prototype/algorithm.mdx rename to documentation/versioned_docs/version-3.10.0/globals/CryptoKey/prototype/algorithm.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-3.10.0/globals/CryptoKey/prototype/extractable.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/CryptoKey/prototype/extractable.mdx rename to documentation/versioned_docs/version-3.10.0/globals/CryptoKey/prototype/extractable.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-3.10.0/globals/CryptoKey/prototype/type.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/CryptoKey/prototype/type.mdx rename to documentation/versioned_docs/version-3.10.0/globals/CryptoKey/prototype/type.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-3.10.0/globals/CryptoKey/prototype/usages.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/CryptoKey/prototype/usages.mdx rename to documentation/versioned_docs/version-3.10.0/globals/CryptoKey/prototype/usages.mdx diff --git a/documentation/versioned_docs/version-3.0.0/globals/DOMException/DOMException.mdx b/documentation/versioned_docs/version-3.10.0/globals/DOMException/DOMException.mdx similarity index 100% rename from documentation/versioned_docs/version-3.0.0/globals/DOMException/DOMException.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DOMException/DOMException.mdx diff --git a/documentation/versioned_docs/version-3.0.0/globals/DOMException/code.mdx b/documentation/versioned_docs/version-3.10.0/globals/DOMException/code.mdx similarity index 100% rename from documentation/versioned_docs/version-3.0.0/globals/DOMException/code.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DOMException/code.mdx diff --git a/documentation/versioned_docs/version-3.0.0/globals/DOMException/message.mdx b/documentation/versioned_docs/version-3.10.0/globals/DOMException/message.mdx similarity index 100% rename from documentation/versioned_docs/version-3.0.0/globals/DOMException/message.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DOMException/message.mdx diff --git a/documentation/versioned_docs/version-3.0.0/globals/DOMException/name.mdx b/documentation/versioned_docs/version-3.10.0/globals/DOMException/name.mdx similarity index 100% rename from documentation/versioned_docs/version-3.0.0/globals/DOMException/name.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DOMException/name.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/DataView.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/DataView.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/DataView.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/buffer.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/buffer.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/buffer.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/byteLength.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/byteLength.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/byteLength.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/byteOffset.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/byteOffset.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/byteOffset.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getBigInt64.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getBigInt64.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getBigInt64.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getBigUint64.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getBigUint64.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getBigUint64.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getFloat32.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getFloat32.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getFloat32.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getFloat64.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getFloat64.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getFloat64.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getInt16.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getInt16.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getInt16.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getInt32.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getInt32.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getInt32.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getInt8.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getInt8.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getInt8.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getUint16.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getUint16.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getUint16.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getUint32.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getUint32.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getUint32.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getUint8.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/getUint8.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/getUint8.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setBigInt64.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setBigInt64.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setBigInt64.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setBigUint64.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setBigUint64.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setBigUint64.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setFloat32.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setFloat32.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setFloat32.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setFloat64.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setFloat64.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setFloat64.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setInt16.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setInt16.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setInt16.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setInt32.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setInt32.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setInt32.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setInt8.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setInt8.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setInt8.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setUint16.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setUint16.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setUint16.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setUint32.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setUint32.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setUint32.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setUint8.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DataView/prototype/setUint8.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DataView/prototype/setUint8.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/Date.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/Date.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/Date.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/UTC.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/UTC.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/UTC.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/now.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/now.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/now.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/now.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/parse.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/parse.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/parse.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/@@toPrimitive.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/@@toPrimitive.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/@@toPrimitive.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getDate.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getDate.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getDate.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getDay.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getDay.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getDay.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getFullYear.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getFullYear.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getFullYear.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getHours.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getHours.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getHours.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getMilliseconds.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getMilliseconds.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getMilliseconds.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getMinutes.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getMinutes.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getMinutes.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getMonth.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getMonth.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getMonth.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getSeconds.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getSeconds.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getSeconds.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getTime.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getTime.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getTime.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getTimezoneOffset.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getTimezoneOffset.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getTimezoneOffset.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCDate.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCDate.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCDate.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCDay.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCDay.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCDay.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCFullYear.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCFullYear.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCFullYear.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCHours.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCHours.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCHours.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCMilliseconds.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCMilliseconds.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCMilliseconds.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCMinutes.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCMinutes.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCMinutes.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCMonth.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCMonth.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCMonth.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCSeconds.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getUTCSeconds.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getUTCSeconds.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getYear.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/getYear.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/getYear.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setDate.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setDate.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setDate.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setFullYear.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setFullYear.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setFullYear.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setHours.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setHours.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setHours.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setMilliseconds.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setMilliseconds.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setMilliseconds.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setMinutes.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setMinutes.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setMinutes.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setMonth.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setMonth.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setMonth.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setSeconds.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setSeconds.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setSeconds.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setTime.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setTime.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setTime.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCDate.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCDate.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCDate.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCFullYear.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCFullYear.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCFullYear.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCHours.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCHours.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCHours.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCMilliseconds.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCMilliseconds.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCMilliseconds.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCMinutes.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCMinutes.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCMinutes.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCMonth.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCMonth.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCMonth.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCSeconds.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setUTCSeconds.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setUTCSeconds.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setYear.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/setYear.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/setYear.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toDateString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toDateString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toDateString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toISOString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toISOString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toISOString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toJSON.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toJSON.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toJSON.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toLocaleDateString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toLocaleDateString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toLocaleDateString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toLocaleString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toLocaleString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toLocaleString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toLocaleTimeString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toLocaleTimeString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toLocaleTimeString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toTimeString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toTimeString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toTimeString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toUTCString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/toUTCString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/toUTCString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Date/prototype/valueOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Date/prototype/valueOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Date/prototype/valueOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-3.10.0/globals/DecompressionStream/DecompressionStream.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DecompressionStream/DecompressionStream.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DecompressionStream/DecompressionStream.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.10.0/globals/DecompressionStream/prototype/readable.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DecompressionStream/prototype/readable.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DecompressionStream/prototype/readable.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.10.0/globals/DecompressionStream/prototype/writable.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/DecompressionStream/prototype/writable.mdx rename to documentation/versioned_docs/version-3.10.0/globals/DecompressionStream/prototype/writable.mdx diff --git a/documentation/versioned_docs/version-3.7.0/globals/EcKeyImportParams/EcKeyImportParams.mdx b/documentation/versioned_docs/version-3.10.0/globals/EcKeyImportParams/EcKeyImportParams.mdx similarity index 100% rename from documentation/versioned_docs/version-3.7.0/globals/EcKeyImportParams/EcKeyImportParams.mdx rename to documentation/versioned_docs/version-3.10.0/globals/EcKeyImportParams/EcKeyImportParams.mdx diff --git a/documentation/versioned_docs/version-3.4.0/globals/EcdsaParams/EcdsaParams.mdx b/documentation/versioned_docs/version-3.10.0/globals/EcdsaParams/EcdsaParams.mdx similarity index 100% rename from documentation/versioned_docs/version-3.4.0/globals/EcdsaParams/EcdsaParams.mdx rename to documentation/versioned_docs/version-3.10.0/globals/EcdsaParams/EcdsaParams.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-3.10.0/globals/Error/Error.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Error/Error.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Error/Error.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-3.10.0/globals/Error/prototype/cause.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Error/prototype/cause.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Error/prototype/cause.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-3.10.0/globals/Error/prototype/message.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Error/prototype/message.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Error/prototype/message.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-3.10.0/globals/Error/prototype/name.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Error/prototype/name.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Error/prototype/name.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Error/prototype/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Error/prototype/toString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Error/prototype/toString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-3.10.0/globals/EvalError/EvalError.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/EvalError/EvalError.mdx rename to documentation/versioned_docs/version-3.10.0/globals/EvalError/EvalError.mdx diff --git a/documentation/versioned_docs/version-3.3.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-3.10.0/globals/FetchEvent/FetchEvent.mdx similarity index 100% rename from documentation/versioned_docs/version-3.3.0/globals/FetchEvent/FetchEvent.mdx rename to documentation/versioned_docs/version-3.10.0/globals/FetchEvent/FetchEvent.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-3.10.0/globals/FetchEvent/prototype/respondWith.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/FetchEvent/prototype/respondWith.mdx rename to documentation/versioned_docs/version-3.10.0/globals/FetchEvent/prototype/respondWith.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-3.10.0/globals/FetchEvent/prototype/waitUntil.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/FetchEvent/prototype/waitUntil.mdx rename to documentation/versioned_docs/version-3.10.0/globals/FetchEvent/prototype/waitUntil.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-3.10.0/globals/FinalizationRegistry/FinalizationRegistry.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/FinalizationRegistry/FinalizationRegistry.mdx rename to documentation/versioned_docs/version-3.10.0/globals/FinalizationRegistry/FinalizationRegistry.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-3.10.0/globals/FinalizationRegistry/prototype/register.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/FinalizationRegistry/prototype/register.mdx rename to documentation/versioned_docs/version-3.10.0/globals/FinalizationRegistry/prototype/register.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-3.10.0/globals/FinalizationRegistry/prototype/unregister.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/FinalizationRegistry/prototype/unregister.mdx rename to documentation/versioned_docs/version-3.10.0/globals/FinalizationRegistry/prototype/unregister.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-3.10.0/globals/Float32Array/Float32Array.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Float32Array/Float32Array.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Float32Array/Float32Array.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-3.10.0/globals/Float64Array/Float64Array.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Float64Array/Float64Array.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Float64Array/Float64Array.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-3.10.0/globals/Function/Function.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Function/Function.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Function/Function.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-3.10.0/globals/Function/prototype/apply.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Function/prototype/apply.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Function/prototype/apply.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-3.10.0/globals/Function/prototype/bind.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Function/prototype/bind.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Function/prototype/bind.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-3.10.0/globals/Function/prototype/call.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Function/prototype/call.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Function/prototype/call.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-3.10.0/globals/Function/prototype/index.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Function/prototype/index.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Function/prototype/index.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-3.10.0/globals/Function/prototype/length.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Function/prototype/length.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Function/prototype/length.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-3.10.0/globals/Function/prototype/name.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Function/prototype/name.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Function/prototype/name.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Function/prototype/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Function/prototype/toString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Function/prototype/toString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-3.10.0/globals/Headers/Headers.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Headers/Headers.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Headers/Headers.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/append.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/append.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/append.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/delete.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/delete.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/delete.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/entries.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/entries.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/entries.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/forEach.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/forEach.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/forEach.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/get.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/get.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/get.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/has.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/has.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/has.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/keys.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/keys.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/keys.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/set.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/set.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/set.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/values.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Headers/prototype/values.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Headers/prototype/values.mdx diff --git a/documentation/versioned_docs/version-3.0.0/globals/HmacImportParams/HmacImportParams.mdx b/documentation/versioned_docs/version-3.10.0/globals/HmacImportParams/HmacImportParams.mdx similarity index 100% rename from documentation/versioned_docs/version-3.0.0/globals/HmacImportParams/HmacImportParams.mdx rename to documentation/versioned_docs/version-3.10.0/globals/HmacImportParams/HmacImportParams.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Infinity.mdx b/documentation/versioned_docs/version-3.10.0/globals/Infinity.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Infinity.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Infinity.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-3.10.0/globals/Int16Array/Int16Array.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Int16Array/Int16Array.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Int16Array/Int16Array.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-3.10.0/globals/Int32Array/Int32Array.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Int32Array/Int32Array.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Int32Array/Int32Array.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-3.10.0/globals/Int8Array/Int8Array.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Int8Array/Int8Array.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Int8Array/Int8Array.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-3.10.0/globals/JSON/parse.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/JSON/parse.mdx rename to documentation/versioned_docs/version-3.10.0/globals/JSON/parse.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-3.10.0/globals/JSON/stringify.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/JSON/stringify.mdx rename to documentation/versioned_docs/version-3.10.0/globals/JSON/stringify.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-3.10.0/globals/Map/@@species.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Map/@@species.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Map/@@species.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-3.10.0/globals/Map/Map.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Map/Map.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Map/Map.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.10.0/globals/Map/prototype/@@iterator.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Map/prototype/@@iterator.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Map/prototype/@@iterator.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-3.10.0/globals/Map/prototype/clear.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Map/prototype/clear.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Map/prototype/clear.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-3.10.0/globals/Map/prototype/delete.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Map/prototype/delete.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Map/prototype/delete.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-3.10.0/globals/Map/prototype/entries.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Map/prototype/entries.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Map/prototype/entries.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-3.10.0/globals/Map/prototype/forEach.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Map/prototype/forEach.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Map/prototype/forEach.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-3.10.0/globals/Map/prototype/get.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Map/prototype/get.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Map/prototype/get.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-3.10.0/globals/Map/prototype/has.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Map/prototype/has.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Map/prototype/has.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-3.10.0/globals/Map/prototype/keys.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Map/prototype/keys.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Map/prototype/keys.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-3.10.0/globals/Map/prototype/set.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Map/prototype/set.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Map/prototype/set.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-3.10.0/globals/Map/prototype/size.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Map/prototype/size.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Map/prototype/size.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-3.10.0/globals/Map/prototype/values.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Map/prototype/values.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Map/prototype/values.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/E.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/E.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/E.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/E.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/LN10.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/LN10.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/LN10.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/LN2.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/LN2.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/LN2.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/LOG10e.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/LOG10e.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/LOG10e.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/LOG2e.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/LOG2e.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/LOG2e.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/PI.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/PI.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/PI.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/SQRT1_2.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/SQRT1_2.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/SQRT1_2.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/SQRT2.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/SQRT2.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/SQRT2.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/abs.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/abs.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/abs.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/acos.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/acos.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/acos.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/acosh.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/acosh.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/acosh.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/asin.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/asin.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/asin.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/asinh.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/asinh.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/asinh.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/atan.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/atan.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/atan.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/atan2.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/atan2.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/atan2.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/atanh.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/atanh.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/atanh.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/cbrt.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/cbrt.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/cbrt.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/ceil.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/ceil.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/ceil.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/clz32.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/clz32.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/clz32.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/cos.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/cos.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/cos.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/cosh.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/cosh.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/cosh.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/exp.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/exp.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/exp.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/expm1.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/expm1.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/expm1.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/floor.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/floor.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/floor.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/fround.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/fround.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/fround.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/hypot.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/hypot.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/hypot.mdx diff --git a/documentation/versioned_docs/version-1.1.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/imul.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/globals/Math/imul.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/imul.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/log.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/log.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/log.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/log.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/log10.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/log10.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/log10.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/log1p.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/log1p.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/log1p.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/log2.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/log2.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/log2.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/max.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/max.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/max.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/max.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/min.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/min.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/min.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/min.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/pow.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/pow.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/pow.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/random.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/random.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/random.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/random.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/round.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/round.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/round.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/round.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/sign.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/sign.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/sign.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/sin.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/sin.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/sin.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/sinh.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/sinh.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/sinh.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/sqrt.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/sqrt.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/sqrt.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/tan.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/tan.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/tan.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/tanh.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/tanh.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/tanh.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-3.10.0/globals/Math/trunc.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Math/trunc.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Math/trunc.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/NaN.mdx b/documentation/versioned_docs/version-3.10.0/globals/NaN.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/NaN.mdx rename to documentation/versioned_docs/version-3.10.0/globals/NaN.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/MAX_SAFE_INTEGER.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/MAX_SAFE_INTEGER.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/MAX_SAFE_INTEGER.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/MAX_VALUE.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/MAX_VALUE.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/MAX_VALUE.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/MIN_SAFE_INTEGER.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/MIN_SAFE_INTEGER.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/MIN_SAFE_INTEGER.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/MIN_VALUE.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/MIN_VALUE.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/MIN_VALUE.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/NEGATIVE_INFINITY.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/NEGATIVE_INFINITY.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/NEGATIVE_INFINITY.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/NaN.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/NaN.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/NaN.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/Number.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/Number.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/Number.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/POSITIVE_INFINITY.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/POSITIVE_INFINITY.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/POSITIVE_INFINITY.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/epsilon.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/epsilon.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/epsilon.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/isFinite.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/isFinite.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/isFinite.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/isInteger.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/isInteger.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/isInteger.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/isNaN.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/isNaN.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/isNaN.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/isSafeInteger.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/isSafeInteger.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/isSafeInteger.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/parseFloat.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/parseFloat.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/parseFloat.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/parseInt.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/parseInt.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/parseInt.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/prototype/toExponential.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/prototype/toExponential.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/prototype/toExponential.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/prototype/toFixed.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/prototype/toFixed.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/prototype/toFixed.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/prototype/toLocaleString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/prototype/toLocaleString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/prototype/toLocaleString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/prototype/toPrecision.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/prototype/toPrecision.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/prototype/toPrecision.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/prototype/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/prototype/toString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/prototype/toString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Number/prototype/valueOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Number/prototype/valueOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Number/prototype/valueOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/Object.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/Object.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/Object.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/assign.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/assign.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/assign.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/create.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/create.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/create.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/create.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/defineProperties.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/defineProperties.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/defineProperties.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/defineProperty.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/defineProperty.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/defineProperty.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/entries.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/entries.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/entries.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/freeze.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/freeze.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/freeze.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/fromEntries.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/fromEntries.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/fromEntries.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/getOwnPropertyDescriptor.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/getOwnPropertyDescriptor.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/getOwnPropertyDescriptor.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/getOwnPropertyDescriptors.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/getOwnPropertyDescriptors.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/getOwnPropertyDescriptors.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/getOwnPropertyNames.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/getOwnPropertyNames.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/getOwnPropertyNames.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/getOwnPropertySymbols.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/getOwnPropertySymbols.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/getOwnPropertySymbols.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/getPrototypeOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/getPrototypeOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/getPrototypeOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/hasOwn.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/hasOwn.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/hasOwn.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/is.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/is.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/is.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/is.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/isExtensible.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/isExtensible.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/isExtensible.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/isFrozen.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/isFrozen.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/isFrozen.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/isSealed.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/isSealed.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/isSealed.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/keys.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/keys.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/keys.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/preventExtensions.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/preventExtensions.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/preventExtensions.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/prototype/constructor.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/prototype/constructor.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/prototype/constructor.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/prototype/hasOwnProperty.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/prototype/hasOwnProperty.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/prototype/hasOwnProperty.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/prototype/isPrototypeOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/prototype/isPrototypeOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/prototype/isPrototypeOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/prototype/propertyIsEnumerable.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/prototype/propertyIsEnumerable.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/prototype/propertyIsEnumerable.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/prototype/toLocaleString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/prototype/toLocaleString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/prototype/toLocaleString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/prototype/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/prototype/toString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/prototype/toString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/prototype/valueOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/prototype/valueOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/prototype/valueOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/seal.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/seal.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/seal.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/setPrototypeOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/setPrototypeOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/setPrototypeOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Object/values.mdx b/documentation/versioned_docs/version-3.10.0/globals/Object/values.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Object/values.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Object/values.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-3.10.0/globals/Promise/@@species.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Promise/@@species.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Promise/@@species.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-3.10.0/globals/Promise/Promise.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Promise/Promise.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Promise/Promise.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-3.10.0/globals/Promise/all.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Promise/all.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Promise/all.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-3.10.0/globals/Promise/allSettled.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Promise/allSettled.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Promise/allSettled.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-3.10.0/globals/Promise/any.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Promise/any.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Promise/any.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-3.10.0/globals/Promise/prototype/catch.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Promise/prototype/catch.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Promise/prototype/catch.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-3.10.0/globals/Promise/prototype/finally.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Promise/prototype/finally.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Promise/prototype/finally.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-3.10.0/globals/Promise/prototype/then.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Promise/prototype/then.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Promise/prototype/then.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-3.10.0/globals/Promise/race.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Promise/race.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Promise/race.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-3.10.0/globals/Promise/reject.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Promise/reject.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Promise/reject.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-3.10.0/globals/Promise/resolve.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Promise/resolve.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Promise/resolve.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/Proxy.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/Proxy.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/Proxy.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/apply.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/apply.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/apply.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/construct.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/construct.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/construct.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/defineProperty.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/defineProperty.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/defineProperty.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/deleteProperty.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/deleteProperty.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/deleteProperty.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/get.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/get.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/get.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/getPrototypeOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/getPrototypeOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/getPrototypeOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/has.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/has.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/has.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/isExtensible.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/isExtensible.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/isExtensible.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/ownKeys.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/ownKeys.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/ownKeys.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/preventExtensions.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/preventExtensions.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/preventExtensions.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/set.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/set.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/set.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/setPrototypeOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Proxy/proxy/setPrototypeOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/proxy/setPrototypeOf.mdx diff --git a/documentation/versioned_docs/version-1.1.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-3.10.0/globals/Proxy/revocable.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/globals/Proxy/revocable.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Proxy/revocable.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-3.10.0/globals/RangeError/RangeError.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/RangeError/RangeError.mdx rename to documentation/versioned_docs/version-3.10.0/globals/RangeError/RangeError.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableByteStreamController/prototype/close.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableByteStreamController/prototype/close.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableByteStreamController/prototype/close.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableByteStreamController/prototype/enqueue.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableByteStreamController/prototype/enqueue.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableByteStreamController/prototype/enqueue.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableByteStreamController/prototype/error.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableByteStreamController/prototype/error.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableByteStreamController/prototype/error.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStream/ReadableStream.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStream/ReadableStream.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStream/ReadableStream.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStream/prototype/cancel.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/cancel.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStream/prototype/cancel.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStream/prototype/getReader.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableStream/prototype/getReader.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStream/prototype/getReader.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStream/prototype/locked.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/locked.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStream/prototype/locked.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStream/prototype/pipeThrough.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/pipeThrough.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStream/prototype/pipeThrough.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStream/prototype/pipeTo.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/pipeTo.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStream/prototype/pipeTo.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStream/prototype/tee.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStream/prototype/tee.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStream/prototype/tee.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBReader/prototype/read.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBReader/prototype/read.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBReader/prototype/read.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultController/prototype/close.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultController/prototype/close.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultController/prototype/close.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultController/prototype/error.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultController/prototype/error.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultController/prototype/error.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultReader/prototype/read.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultReader/prototype/read.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultReader/prototype/read.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-3.10.0/globals/ReferenceError/ReferenceError.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/ReferenceError/ReferenceError.mdx rename to documentation/versioned_docs/version-3.10.0/globals/ReferenceError/ReferenceError.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-3.10.0/globals/Reflect/apply.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Reflect/apply.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Reflect/apply.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-3.10.0/globals/Reflect/construct.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Reflect/construct.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Reflect/construct.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-3.10.0/globals/Reflect/defineProperty.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Reflect/defineProperty.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Reflect/defineProperty.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-3.10.0/globals/Reflect/deleteProperty.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Reflect/deleteProperty.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Reflect/deleteProperty.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-3.10.0/globals/Reflect/get.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Reflect/get.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Reflect/get.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.10.0/globals/Reflect/getOwnPropertyDescriptor.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Reflect/getOwnPropertyDescriptor.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Reflect/getOwnPropertyDescriptor.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Reflect/getPrototypeOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Reflect/getPrototypeOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Reflect/getPrototypeOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-3.10.0/globals/Reflect/has.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Reflect/has.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Reflect/has.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-3.10.0/globals/Reflect/isExtensible.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Reflect/isExtensible.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Reflect/isExtensible.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-3.10.0/globals/Reflect/ownKeys.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Reflect/ownKeys.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Reflect/ownKeys.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-3.10.0/globals/Reflect/preventExtensions.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Reflect/preventExtensions.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Reflect/preventExtensions.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-3.10.0/globals/Reflect/set.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Reflect/set.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Reflect/set.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Reflect/setPrototypeOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Reflect/setPrototypeOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Reflect/setPrototypeOf.mdx diff --git a/documentation/versioned_docs/version-3.8.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-3.10.0/globals/Request/Request.mdx similarity index 100% rename from documentation/versioned_docs/version-3.8.0/globals/Request/Request.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Request/Request.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.10.0/globals/Request/prototype/arrayBuffer.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Request/prototype/arrayBuffer.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Request/prototype/arrayBuffer.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-3.10.0/globals/Request/prototype/body.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Request/prototype/body.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Request/prototype/body.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.10.0/globals/Request/prototype/bodyUsed.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Request/prototype/bodyUsed.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Request/prototype/bodyUsed.mdx diff --git a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/clone.mdx b/documentation/versioned_docs/version-3.10.0/globals/Request/prototype/clone.mdx similarity index 100% rename from documentation/versioned_docs/version-3.3.2/globals/Request/prototype/clone.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Request/prototype/clone.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-3.10.0/globals/Request/prototype/headers.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Request/prototype/headers.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Request/prototype/headers.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-3.10.0/globals/Request/prototype/json.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Request/prototype/json.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Request/prototype/json.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-3.10.0/globals/Request/prototype/method.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Request/prototype/method.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Request/prototype/method.mdx diff --git a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/setManualFramingHeaders.mdx b/documentation/versioned_docs/version-3.10.0/globals/Request/prototype/setManualFramingHeaders.mdx similarity index 100% rename from documentation/versioned_docs/version-3.8.0/globals/Request/prototype/setManualFramingHeaders.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Request/prototype/setManualFramingHeaders.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-3.10.0/globals/Request/prototype/text.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Request/prototype/text.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Request/prototype/text.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-3.10.0/globals/Request/prototype/url.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Request/prototype/url.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Request/prototype/url.mdx diff --git a/documentation/versioned_docs/version-3.8.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-3.10.0/globals/Response/Response.mdx similarity index 100% rename from documentation/versioned_docs/version-3.8.0/globals/Response/Response.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Response/Response.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.10.0/globals/Response/prototype/arrayBuffer.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Response/prototype/arrayBuffer.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Response/prototype/arrayBuffer.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-3.10.0/globals/Response/prototype/body.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Response/prototype/body.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Response/prototype/body.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.10.0/globals/Response/prototype/bodyUsed.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Response/prototype/bodyUsed.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Response/prototype/bodyUsed.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-3.10.0/globals/Response/prototype/headers.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Response/prototype/headers.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Response/prototype/headers.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-3.10.0/globals/Response/prototype/json.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Response/prototype/json.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Response/prototype/json.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-3.10.0/globals/Response/prototype/ok.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Response/prototype/ok.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Response/prototype/ok.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-3.10.0/globals/Response/prototype/status.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Response/prototype/status.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Response/prototype/status.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-3.10.0/globals/Response/prototype/statusText.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Response/prototype/statusText.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Response/prototype/statusText.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-3.10.0/globals/Response/prototype/text.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Response/prototype/text.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Response/prototype/text.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-3.10.0/globals/Response/prototype/url.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Response/prototype/url.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Response/prototype/url.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-3.10.0/globals/Response/redirect.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/Response/redirect.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Response/redirect.mdx diff --git a/documentation/versioned_docs/version-3.8.0/globals/Response/setManualFramingHeaders.mdx b/documentation/versioned_docs/version-3.10.0/globals/Response/setManualFramingHeaders.mdx similarity index 100% rename from documentation/versioned_docs/version-3.8.0/globals/Response/setManualFramingHeaders.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Response/setManualFramingHeaders.mdx diff --git a/documentation/versioned_docs/version-3.0.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-3.10.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx similarity index 100% rename from documentation/versioned_docs/version-3.0.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx rename to documentation/versioned_docs/version-3.10.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-3.10.0/globals/Set/@@species.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Set/@@species.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Set/@@species.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-3.10.0/globals/Set/Set.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Set/Set.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Set/Set.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.10.0/globals/Set/prototype/@@iterator.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Set/prototype/@@iterator.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Set/prototype/@@iterator.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-3.10.0/globals/Set/prototype/add.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Set/prototype/add.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Set/prototype/add.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-3.10.0/globals/Set/prototype/clear.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Set/prototype/clear.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Set/prototype/clear.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-3.10.0/globals/Set/prototype/delete.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Set/prototype/delete.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Set/prototype/delete.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-3.10.0/globals/Set/prototype/entries.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Set/prototype/entries.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Set/prototype/entries.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-3.10.0/globals/Set/prototype/forEach.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Set/prototype/forEach.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Set/prototype/forEach.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-3.10.0/globals/Set/prototype/has.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Set/prototype/has.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Set/prototype/has.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-3.10.0/globals/Set/prototype/keys.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Set/prototype/keys.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Set/prototype/keys.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-3.10.0/globals/Set/prototype/size.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Set/prototype/size.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Set/prototype/size.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-3.10.0/globals/Set/prototype/values.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Set/prototype/values.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Set/prototype/values.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/String.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/String.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/String.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/String.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/fromCharCode.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/fromCharCode.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/fromCharCode.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/fromCodePoint.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/fromCodePoint.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/fromCodePoint.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/@@iterator.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/@@iterator.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/@@iterator.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/at.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/at.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/at.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/charAt.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/charAt.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/charAt.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/charCodeAt.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/charCodeAt.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/charCodeAt.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/codePointAt.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/codePointAt.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/codePointAt.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/concat.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/concat.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/concat.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/endsWith.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/endsWith.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/endsWith.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/includes.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/includes.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/includes.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/indexOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/indexOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/indexOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/lastIndexOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/lastIndexOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/lastIndexOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/length.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/length.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/length.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/localeCompare.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/localeCompare.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/localeCompare.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/match.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/match.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/match.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/matchAll.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/matchAll.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/matchAll.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/padEnd.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/padEnd.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/padEnd.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/padStart.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/padStart.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/padStart.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/repeat.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/String/prototype/repeat.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/repeat.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/replace.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/replace.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/replace.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/replaceAll.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/replaceAll.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/replaceAll.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/search.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/search.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/search.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/slice.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/slice.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/slice.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/split.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/split.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/split.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/startsWith.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/startsWith.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/startsWith.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/substr.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/substr.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/substr.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/substring.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/substring.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/substring.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/toLocaleLowerCase.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/toLocaleLowerCase.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/toLocaleLowerCase.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/toLocaleUpperCase.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/toLocaleUpperCase.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/toLocaleUpperCase.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/toLowerCase.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/toLowerCase.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/toLowerCase.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/toString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/toString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/toUpperCase.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/toUpperCase.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/toUpperCase.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/trim.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/trim.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/trim.mdx diff --git a/documentation/versioned_docs/version-1.1.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/trimEnd.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/globals/String/prototype/trimEnd.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/trimEnd.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/trimStart.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/trimStart.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/trimStart.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/prototype/valueOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/prototype/valueOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/prototype/valueOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/String/raw.mdx b/documentation/versioned_docs/version-3.10.0/globals/String/raw.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/String/raw.mdx rename to documentation/versioned_docs/version-3.10.0/globals/String/raw.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-3.10.0/globals/SubtleCrypto/SubtleCrypto.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/SubtleCrypto.mdx rename to documentation/versioned_docs/version-3.10.0/globals/SubtleCrypto/SubtleCrypto.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-3.10.0/globals/SubtleCrypto/prototype/digest.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/SubtleCrypto/prototype/digest.mdx rename to documentation/versioned_docs/version-3.10.0/globals/SubtleCrypto/prototype/digest.mdx diff --git a/documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-3.10.0/globals/SubtleCrypto/prototype/importKey.mdx similarity index 100% rename from documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/importKey.mdx rename to documentation/versioned_docs/version-3.10.0/globals/SubtleCrypto/prototype/importKey.mdx diff --git a/documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-3.10.0/globals/SubtleCrypto/prototype/sign.mdx similarity index 100% rename from documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/prototype/sign.mdx rename to documentation/versioned_docs/version-3.10.0/globals/SubtleCrypto/prototype/sign.mdx diff --git a/documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-3.10.0/globals/SubtleCrypto/prototype/verify.mdx similarity index 100% rename from documentation/versioned_docs/version-3.0.0/globals/SubtleCrypto/prototype/verify.mdx rename to documentation/versioned_docs/version-3.10.0/globals/SubtleCrypto/prototype/verify.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/Symbol.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/Symbol.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/Symbol.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/asyncIterator.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/asyncIterator.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/asyncIterator.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/for.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/for.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/for.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/hasInstance.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/hasInstance.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/hasInstance.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/isConcatSpreadable.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/isConcatSpreadable.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/isConcatSpreadable.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/iterator.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/iterator.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/iterator.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/keyFor.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/keyFor.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/keyFor.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/match.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/match.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/match.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/matchAll.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/matchAll.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/matchAll.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/prototype/@@toPrimitive.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/prototype/@@toPrimitive.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/prototype/@@toPrimitive.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/prototype/description.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/prototype/description.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/prototype/description.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/prototype/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/prototype/toString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/prototype/toString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/prototype/valueOf.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/prototype/valueOf.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/prototype/valueOf.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/replace.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/replace.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/replace.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/search.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/search.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/search.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/species.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/species.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/species.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/split.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/split.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/split.mdx diff --git a/documentation/versioned_docs/version-1.1.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/toPrimitive.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/globals/Symbol/toPrimitive.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/toPrimitive.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/toStringTag.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/toStringTag.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/toStringTag.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-3.10.0/globals/Symbol/unscopables.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Symbol/unscopables.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Symbol/unscopables.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-3.10.0/globals/SyntaxError/SyntaxError.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/SyntaxError/SyntaxError.mdx rename to documentation/versioned_docs/version-3.10.0/globals/SyntaxError/SyntaxError.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-3.10.0/globals/TextDecoder/TextDecoder.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TextDecoder/TextDecoder.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TextDecoder/TextDecoder.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-3.10.0/globals/TextDecoder/prototype/decode.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TextDecoder/prototype/decode.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TextDecoder/prototype/decode.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.10.0/globals/TextDecoder/prototype/encoding.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TextDecoder/prototype/encoding.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TextDecoder/prototype/encoding.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-3.10.0/globals/TextDecoder/prototype/fatal.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TextDecoder/prototype/fatal.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TextDecoder/prototype/fatal.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-3.10.0/globals/TextDecoder/prototype/ignoreBOM.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TextDecoder/prototype/ignoreBOM.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TextDecoder/prototype/ignoreBOM.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-3.10.0/globals/TextEncoder/TextEncoder.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TextEncoder/TextEncoder.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TextEncoder/TextEncoder.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-3.10.0/globals/TextEncoder/prototype/encode.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TextEncoder/prototype/encode.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TextEncoder/prototype/encode.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.10.0/globals/TextEncoder/prototype/encoding.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TextEncoder/prototype/encoding.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TextEncoder/prototype/encoding.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-3.10.0/globals/TransformStream/TransformStream.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TransformStream/TransformStream.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TransformStream/TransformStream.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.10.0/globals/TransformStream/prototype/readable.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TransformStream/prototype/readable.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TransformStream/prototype/readable.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.10.0/globals/TransformStream/prototype/writable.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TransformStream/prototype/writable.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TransformStream/prototype/writable.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.10.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.10.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.10.0/globals/TransformStreamDefaultController/prototype/error.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TransformStreamDefaultController/prototype/error.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TransformStreamDefaultController/prototype/error.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-3.10.0/globals/TransformStreamDefaultController/prototype/terminate.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TransformStreamDefaultController/prototype/terminate.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TransformStreamDefaultController/prototype/terminate.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-3.10.0/globals/TypeError/TypeError.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/TypeError/TypeError.mdx rename to documentation/versioned_docs/version-3.10.0/globals/TypeError/TypeError.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-3.10.0/globals/URIError/URIError.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URIError/URIError.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URIError/URIError.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/URL.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/URL.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/URL.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/hash.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/hash.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/hash.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/host.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/host.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/host.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/hostname.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/hostname.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/hostname.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/href.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/href.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/href.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/origin.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/origin.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/origin.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/password.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/password.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/password.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/pathname.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/pathname.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/pathname.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/port.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/port.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/port.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/protocol.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/protocol.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/protocol.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/search.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/search.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/search.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/searchParams.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/searchParams.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/searchParams.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/toJSON.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/toJSON.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/toJSON.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/toString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/toString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-3.10.0/globals/URL/prototype/username.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URL/prototype/username.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URL/prototype/username.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/URLSearchParams.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/URLSearchParams.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/URLSearchParams.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/append.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/append.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/append.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/delete.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/delete.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/delete.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/entries.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/entries.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/entries.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/forEach.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/forEach.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/forEach.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/get.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/get.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/get.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/has.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/has.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/has.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/keys.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/keys.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/keys.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/set.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/set.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/set.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/sort.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/sort.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/sort.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/toString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/toString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/values.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/URLSearchParams/prototype/values.mdx rename to documentation/versioned_docs/version-3.10.0/globals/URLSearchParams/prototype/values.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-3.10.0/globals/Uint16Array/Uint16Array.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Uint16Array/Uint16Array.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Uint16Array/Uint16Array.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-3.10.0/globals/Uint32Array/Uint32Array.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Uint32Array/Uint32Array.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Uint32Array/Uint32Array.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-3.10.0/globals/Uint8Array/Uint8Array.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Uint8Array/Uint8Array.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Uint8Array/Uint8Array.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-3.10.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx rename to documentation/versioned_docs/version-3.10.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-3.10.0/globals/WeakMap/WeakMap.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WeakMap/WeakMap.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WeakMap/WeakMap.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-3.10.0/globals/WeakMap/prototype/delete.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WeakMap/prototype/delete.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WeakMap/prototype/delete.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-3.10.0/globals/WeakMap/prototype/get.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WeakMap/prototype/get.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WeakMap/prototype/get.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-3.10.0/globals/WeakMap/prototype/has.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WeakMap/prototype/has.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WeakMap/prototype/has.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-3.10.0/globals/WeakMap/prototype/set.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WeakMap/prototype/set.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WeakMap/prototype/set.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-3.10.0/globals/WeakRef/WeakRef.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WeakRef/WeakRef.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WeakRef/WeakRef.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-3.10.0/globals/WeakRef/prototype/deref.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WeakRef/prototype/deref.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WeakRef/prototype/deref.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-3.10.0/globals/WeakSet/WeakSet.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WeakSet/WeakSet.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WeakSet/WeakSet.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-3.10.0/globals/WeakSet/prototype/add.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WeakSet/prototype/add.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WeakSet/prototype/add.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-3.10.0/globals/WeakSet/prototype/delete.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WeakSet/prototype/delete.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WeakSet/prototype/delete.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-3.10.0/globals/WeakSet/prototype/has.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WeakSet/prototype/has.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WeakSet/prototype/has.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/WorkerLocation.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/WorkerLocation.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/WorkerLocation.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/hash.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/hash.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/hash.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/host.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/host.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/host.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/hostname.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/hostname.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/hostname.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/href.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/href.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/href.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/origin.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/origin.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/origin.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/pathname.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/pathname.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/pathname.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/port.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/port.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/port.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/protocol.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/protocol.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/protocol.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/search.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/search.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/search.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/toString.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WorkerLocation/toString.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WorkerLocation/toString.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-3.10.0/globals/WritableStream/WritableStream.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WritableStream/WritableStream.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WritableStream/WritableStream.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-3.10.0/globals/WritableStream/prototype/abort.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WritableStream/prototype/abort.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WritableStream/prototype/abort.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-3.10.0/globals/WritableStream/prototype/getWriter.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WritableStream/prototype/getWriter.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WritableStream/prototype/getWriter.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.10.0/globals/WritableStream/prototype/locked.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WritableStream/prototype/locked.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WritableStream/prototype/locked.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultController/error.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultController/error.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultController/error.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/close.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/close.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/close.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/write.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/WritableStreamDefaultWriter/prototype/write.mdx rename to documentation/versioned_docs/version-3.10.0/globals/WritableStreamDefaultWriter/prototype/write.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/atob.mdx b/documentation/versioned_docs/version-3.10.0/globals/atob.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/atob.mdx rename to documentation/versioned_docs/version-3.10.0/globals/atob.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/btoa.mdx b/documentation/versioned_docs/version-3.10.0/globals/btoa.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/btoa.mdx rename to documentation/versioned_docs/version-3.10.0/globals/btoa.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-3.10.0/globals/clearInterval.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/clearInterval.mdx rename to documentation/versioned_docs/version-3.10.0/globals/clearInterval.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-3.10.0/globals/clearTimeout.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/clearTimeout.mdx rename to documentation/versioned_docs/version-3.10.0/globals/clearTimeout.mdx diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/assert.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/assert.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/globals/console/assert.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/assert.mdx diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/clear.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/clear.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/globals/console/clear.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/clear.mdx diff --git a/documentation/versioned_docs/version-3.0.0/globals/console/count.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/count.mdx similarity index 100% rename from documentation/versioned_docs/version-3.0.0/globals/console/count.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/count.mdx diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/countReset.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/globals/console/countReset.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/countReset.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/console/debug.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/debug.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/console/debug.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/debug.mdx diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/dir.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/dir.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/globals/console/dir.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/dir.mdx diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/dirxml.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/globals/console/dirxml.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/dirxml.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/console/error.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/error.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/console/error.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/error.mdx diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/group.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/group.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/globals/console/group.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/group.mdx diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/groupCollapsed.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/globals/console/groupCollapsed.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/groupCollapsed.mdx diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/groupEnd.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/globals/console/groupEnd.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/groupEnd.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/console/info.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/info.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/console/info.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/info.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/console/log.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/log.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/console/log.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/log.mdx diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/time.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/time.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/globals/console/time.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/time.mdx diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/timeEnd.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/globals/console/timeEnd.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/timeEnd.mdx diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/timeLog.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/globals/console/timeLog.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/timeLog.mdx diff --git a/documentation/versioned_docs/version-2.0.0/globals/console/trace.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/trace.mdx similarity index 100% rename from documentation/versioned_docs/version-2.0.0/globals/console/trace.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/trace.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/console/warn.mdx b/documentation/versioned_docs/version-3.10.0/globals/console/warn.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/console/warn.mdx rename to documentation/versioned_docs/version-3.10.0/globals/console/warn.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-3.10.0/globals/crypto/getRandomValues.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/crypto/getRandomValues.mdx rename to documentation/versioned_docs/version-3.10.0/globals/crypto/getRandomValues.mdx diff --git a/documentation/versioned_docs/version-1.1.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-3.10.0/globals/crypto/randomUUID.mdx similarity index 100% rename from documentation/versioned_docs/version-1.1.0/globals/crypto/randomUUID.mdx rename to documentation/versioned_docs/version-3.10.0/globals/crypto/randomUUID.mdx diff --git a/documentation/versioned_docs/version-1.10.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-3.10.0/globals/crypto/subtle.mdx similarity index 100% rename from documentation/versioned_docs/version-1.10.0/globals/crypto/subtle.mdx rename to documentation/versioned_docs/version-3.10.0/globals/crypto/subtle.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-3.10.0/globals/decodeURI.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/decodeURI.mdx rename to documentation/versioned_docs/version-3.10.0/globals/decodeURI.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-3.10.0/globals/decodeURIComponent.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/decodeURIComponent.mdx rename to documentation/versioned_docs/version-3.10.0/globals/decodeURIComponent.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-3.10.0/globals/encodeURI.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/encodeURI.mdx rename to documentation/versioned_docs/version-3.10.0/globals/encodeURI.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-3.10.0/globals/encodeURIComponent.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/encodeURIComponent.mdx rename to documentation/versioned_docs/version-3.10.0/globals/encodeURIComponent.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/escape.mdx b/documentation/versioned_docs/version-3.10.0/globals/escape.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/escape.mdx rename to documentation/versioned_docs/version-3.10.0/globals/escape.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/eval.mdx b/documentation/versioned_docs/version-3.10.0/globals/eval.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/eval.mdx rename to documentation/versioned_docs/version-3.10.0/globals/eval.mdx diff --git a/documentation/versioned_docs/version-3.2.0/globals/fetch.mdx b/documentation/versioned_docs/version-3.10.0/globals/fetch.mdx similarity index 100% rename from documentation/versioned_docs/version-3.2.0/globals/fetch.mdx rename to documentation/versioned_docs/version-3.10.0/globals/fetch.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/globalThis.mdx b/documentation/versioned_docs/version-3.10.0/globals/globalThis.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/globalThis.mdx rename to documentation/versioned_docs/version-3.10.0/globals/globalThis.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/isFinite.mdx b/documentation/versioned_docs/version-3.10.0/globals/isFinite.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/isFinite.mdx rename to documentation/versioned_docs/version-3.10.0/globals/isFinite.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/isNaN.mdx b/documentation/versioned_docs/version-3.10.0/globals/isNaN.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/isNaN.mdx rename to documentation/versioned_docs/version-3.10.0/globals/isNaN.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/location.mdx b/documentation/versioned_docs/version-3.10.0/globals/location.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/location.mdx rename to documentation/versioned_docs/version-3.10.0/globals/location.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-3.10.0/globals/parseFloat.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/parseFloat.mdx rename to documentation/versioned_docs/version-3.10.0/globals/parseFloat.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/parseInt.mdx b/documentation/versioned_docs/version-3.10.0/globals/parseInt.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/parseInt.mdx rename to documentation/versioned_docs/version-3.10.0/globals/parseInt.mdx diff --git a/documentation/versioned_docs/version-2.3.0/globals/performance/now.mdx b/documentation/versioned_docs/version-3.10.0/globals/performance/now.mdx similarity index 100% rename from documentation/versioned_docs/version-2.3.0/globals/performance/now.mdx rename to documentation/versioned_docs/version-3.10.0/globals/performance/now.mdx diff --git a/documentation/versioned_docs/version-2.3.0/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-3.10.0/globals/performance/timeOrigin.mdx similarity index 100% rename from documentation/versioned_docs/version-2.3.0/globals/performance/timeOrigin.mdx rename to documentation/versioned_docs/version-3.10.0/globals/performance/timeOrigin.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/setInterval.mdx b/documentation/versioned_docs/version-3.10.0/globals/setInterval.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/setInterval.mdx rename to documentation/versioned_docs/version-3.10.0/globals/setInterval.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-3.10.0/globals/setTimeout.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/setTimeout.mdx rename to documentation/versioned_docs/version-3.10.0/globals/setTimeout.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-3.10.0/globals/structuredClone.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/structuredClone.mdx rename to documentation/versioned_docs/version-3.10.0/globals/structuredClone.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/undefined.mdx b/documentation/versioned_docs/version-3.10.0/globals/undefined.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/undefined.mdx rename to documentation/versioned_docs/version-3.10.0/globals/undefined.mdx diff --git a/documentation/versioned_docs/version-1.0.0/globals/unescape.mdx b/documentation/versioned_docs/version-3.10.0/globals/unescape.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/globals/unescape.mdx rename to documentation/versioned_docs/version-3.10.0/globals/unescape.mdx diff --git a/documentation/versioned_docs/version-1.0.0/index.mdx b/documentation/versioned_docs/version-3.10.0/index.mdx similarity index 100% rename from documentation/versioned_docs/version-1.0.0/index.mdx rename to documentation/versioned_docs/version-3.10.0/index.mdx diff --git a/documentation/versioned_docs/version-3.0.0/migration-guide/index.mdx b/documentation/versioned_docs/version-3.10.0/migration-guide/index.mdx similarity index 100% rename from documentation/versioned_docs/version-3.0.0/migration-guide/index.mdx rename to documentation/versioned_docs/version-3.10.0/migration-guide/index.mdx diff --git a/documentation/versioned_docs/version-3.2.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-3.2.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index fffeca92b7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,227 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `dontPool` _: boolean_ _**optional**_ - - Determine whether or not connections to the same backend should be pooled across different sessions. - - Fastly considers two backends “the same” if they're registered with the same name and the exact same settings. - - In those cases, when pooling is enabled, if Session 1 opens a connection to this backend it will be left open, and can be re-used by Session 2. - - This can help improve backend latency, by removing the need for the initial network / TLS handshake(s). - - By default, pooling is enabled for dynamic backends. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-3.2.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-3.2.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index 8803456915..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, and return a message stating whether the entry was in the Fastly Cache or not. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - return new Response(page ? `${path} is in the cache` : `${path} is not in the cache`, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index a15a22dc09..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key` if no entry is found (or has expired), the supplied `set` function is executed and it's result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - : A function to execute when the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. - - `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/purge.mdx b/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/purge.mdx deleted file mode 100644 index 44ac6ff92c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCache/purge.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# SimpleCache.purge - -purge the entry associated with the key `key` from the cache. - -## Syntax - -```js -purge(key, options) -``` - -### Parameters - -- `key` _: string_ - - The key to purge from within the cache. - -- `options` _: object_ - - `scope` _: string_ - - : Where to purge the content from. - - Possible values are: - - "global" - This will remove the content from all of Fastly. - - "pop" - This will remove the content from the POP that contains the currently executing instance. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `purge` querystring parameter, we purge the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('purge')) { - SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-3.2.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-3.2.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-3.2.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-3.2.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-3.2.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:env/env.mdx b/documentation/versioned_docs/version-3.2.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.2.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-3.2.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-3.2.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-3.2.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-3.2.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-3.2.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index cd63199613..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/kv-stores/#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-3.2.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-3.2.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-3.2.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.2.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-3.2.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.2.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-3.2.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-3.2.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-3.2.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/from.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/of.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-3.2.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-3.2.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-3.2.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.2.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-3.2.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.2.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.2.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-3.2.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-3.2.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-3.2.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.2.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-3.2.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-3.2.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-3.2.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-3.2.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-3.2.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-3.2.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.2.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.2.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.2.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DOMException/DOMException.mdx b/documentation/versioned_docs/version-3.2.0/globals/DOMException/DOMException.mdx deleted file mode 100644 index 160e40e774..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DOMException/DOMException.mdx +++ /dev/null @@ -1,107 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException() - -The **`DOMException()`** constructor returns a `DOMException` object with a specified message and name. - -## Syntax - -```js -new DOMException() -new DOMException(message) -new DOMException(message, name) -``` - -### Parameters - -- `message` _optional_ - - : A description of the exception. If not present, the empty string `''` is - used. -- `name` _optional_ - - : A string. If the specified name is a [standard error name](#error-names), then getting the [`code`](./code.mdx) property of the `DOMException` object will return the code number corresponding to the specified name. - -### Return value - -A newly created `DOMException` object. - -## Error names - -Common error names are listed here. Some APIs define their own sets of names, so this is not necessarily a complete list. - -Note that the following deprecated historical errors don't have an error name but instead have only a legacy constant code value and a legacy constant name: - -- Legacy code value: `2`, legacy constant name: `DOMSTRING_SIZE_ERR` -- Legacy code value: `6`, legacy constant name: `NO_DATA_ALLOWED_ERR` -- Legacy code value: `16`, legacy constant name: `VALIDATION_ERR` - -> **Note:** Because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past. - -- `IndexSizeError` - - : The index is not in the allowed range. (Legacy code value: `1` and legacy constant name: `INDEX_SIZE_ERR`) -- `HierarchyRequestError` - - : The node tree hierarchy is not correct. (Legacy code value: `3` and legacy constant name: `HIERARCHY_REQUEST_ERR`) -- `WrongDocumentError` - - : The object is in the wrong `Document`. (Legacy code value: `4` and legacy constant name: `WRONG_DOCUMENT_ERR`) -- `InvalidCharacterError` - - : The string contains invalid characters. (Legacy code value: `5` and legacy constant name: `INVALID_CHARACTER_ERR`) -- `NoModificationAllowedError` - - : The object cannot be modified. (Legacy code value: `7` and legacy constant name: `NO_MODIFICATION_ALLOWED_ERR`) -- `NotFoundError` - - : The object cannot be found here. (Legacy code value: `8` and legacy constant name: `NOT_FOUND_ERR`) -- `NotSupportedError` - - : The operation is not supported. (Legacy code value: `9` and legacy constant name: `NOT_SUPPORTED_ERR`) -- `InvalidStateError` - - : The object is in an invalid state. (Legacy code value: `11` and legacy constant name: `INVALID_STATE_ERR`) -- `InUseAttributeError` - - : The attribute is in use. (Legacy code value: `10` and legacy constant name: `INUSE_ATTRIBUTE_ERR`) -- `SyntaxError` - - : The string did not match the expected pattern. (Legacy code value: `12` and legacy constant name: `SYNTAX_ERR`) -- `InvalidModificationError` - - : The object cannot be modified in this way. (Legacy code value: `13` and legacy constant name: `INVALID_MODIFICATION_ERR`) -- `NamespaceError` - - : The operation is not allowed by Namespaces in XML. (Legacy code value: `14` and legacy constant name: `NAMESPACE_ERR`) -- `InvalidAccessError` - - : The object does not support the operation or argument. (Legacy code value: `15` and legacy constant name: `INVALID_ACCESS_ERR`) -- `TypeMismatchError` *deprecated* - - : The type of the object does not match the expected type. (Legacy code value: `17` and legacy constant name: `TYPE_MISMATCH_ERR`) This value is deprecated; the JavaScript `TypeError` exception is now raised instead of a `DOMException` with this value. -- `SecurityError` - - : The operation is insecure. (Legacy code value: `18` and legacy constant name: `SECURITY_ERR`) -- `NetworkError` - - : A network error occurred. (Legacy code value: `19` and legacy constant name: `NETWORK_ERR`) -- `AbortError` - - : The operation was aborted. (Legacy code value: `20` and legacy constant name: `ABORT_ERR`) -- `URLMismatchError` - - : The given URL does not match another URL. (Legacy code value: `21` and legacy constant name: `URL_MISMATCH_ERR`) -- `QuotaExceededError` - - : The quota has been exceeded. (Legacy code value: `22` and legacy constant name: `QUOTA_EXCEEDED_ERR`) -- `TimeoutError` - - : The operation timed out. (Legacy code value: `23` and legacy constant name: `TIMEOUT_ERR`) -- `InvalidNodeTypeError` - - : The node is incorrect or has an incorrect ancestor for this operation. (Legacy code value: `24` and legacy constant name: `INVALID_NODE_TYPE_ERR`) -- `DataCloneError` - - : The object can not be cloned. (Legacy code value: `25` and legacy constant name: `DATA_CLONE_ERR`) -- `EncodingError` - - : The encoding or decoding operation failed (No legacy code value and constant name). -- `NotReadableError` - - : The input/output read operation failed (No legacy code value and constant name). -- `UnknownError` - - : The operation failed for an unknown transient reason (e.g. out of memory) (No legacy code value and constant name). -- `ConstraintError` - - : A mutation operation in a transaction failed because a constraint was not satisfied (No legacy code value and constant name). -- `DataError` - - : Provided data is inadequate (No legacy code value and constant name). -- `TransactionInactiveError` - - : A request was placed against a transaction that is currently not active or is finished (No legacy code value and constant name). -- `ReadOnlyError` - - : The mutating operation was attempted in a "readonly" transaction (No legacy code value and constant name). -- `VersionError` - - : An attempt was made to open a database using a lower version than the existing version (No legacy code value and constant name). -- `OperationError` - - : The operation failed for an operation-specific reason (No legacy code value and constant name). -- `NotAllowedError` - - : The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (No legacy code value and constant name). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/globals/DOMException/code.mdx b/documentation/versioned_docs/version-3.2.0/globals/DOMException/code.mdx deleted file mode 100644 index 21b9836fa4..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DOMException/code.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.code - -The **`code`** read-only property of the `DOMException` interface returns one of the legacy [error code constants](./DOMException.mdx#error-names), or `0` if none match. - -This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the [`name`](./name.mdx) attribute. - -## Value - -One of the [error code constants](./DOMException.mdx#error-names), or `0` if none match. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DOMException/message.mdx b/documentation/versioned_docs/version-3.2.0/globals/DOMException/message.mdx deleted file mode 100644 index 44d3c6b8da..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DOMException/message.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.message - -The **`message`** read-only property of the `DOMException` interface returns a string representing a message or description associated with the given [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DOMException/name.mdx b/documentation/versioned_docs/version-3.2.0/globals/DOMException/name.mdx deleted file mode 100644 index 1dda11b92c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DOMException/name.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.name - -The **`name`** read-only property of the `DOMException` interface returns a string that contains one of the strings associated with an [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/now.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-3.2.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.2.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.2.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-3.2.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-3.2.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-3.2.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-3.2.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-3.2.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-3.2.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.2.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-3.2.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 9e5e18d906..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-3.2.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-3.2.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-3.2.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-3.2.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-3.2.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-3.2.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-3.2.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-3.2.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-3.2.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-3.2.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-3.2.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-3.2.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.2.0/globals/HmacImportParams/HmacImportParams.mdx b/documentation/versioned_docs/version-3.2.0/globals/HmacImportParams/HmacImportParams.mdx deleted file mode 100644 index 816aa2e7dc..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/HmacImportParams/HmacImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# HmacImportParams - -The **`HmacImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey`, when generating a key for the `HMAC` algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `HMAC`. -- `hash` - - - : A string representing the name of the digest function to use. The can take a value of `SHA-1`, `SHA-256`, `SHA-384`, or `SHA-512`. - -- `length` _optional_ - - : A `Number` representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/Infinity.mdx b/documentation/versioned_docs/version-3.2.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-3.2.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-3.2.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-3.2.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.2.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-3.2.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-3.2.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-3.2.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-3.2.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-3.2.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/E.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/log.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/max.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/min.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/random.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/round.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-3.2.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/NaN.mdx b/documentation/versioned_docs/version-3.2.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/create.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/is.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Object/values.mdx b/documentation/versioned_docs/version-3.2.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-3.2.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-3.2.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-3.2.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-3.2.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-3.2.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-3.2.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-3.2.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-3.2.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-3.2.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-3.2.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-3.2.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-3.2.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-3.2.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-3.2.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-3.2.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-3.2.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-3.2.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-3.2.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-3.2.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-3.2.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.2.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-3.2.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-3.2.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-3.2.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-3.2.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-3.2.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-3.2.0/globals/Request/Request.mdx deleted file mode 100644 index 81af5a46cf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Request/Request.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-3.2.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-3.2.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-3.2.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-3.2.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 3477966947..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-3.2.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-3.2.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/String.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.2.0/globals/String/raw.mdx b/documentation/versioned_docs/version-3.2.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 1e17f6d925..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `raw`: [Raw](#raw) format. - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. - - For HMAC: - Pass an [`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - -### Raw - -You can use this format to import or export AES or HMAC secret keys, or Elliptic Curve -public keys. - -In this format the key is supplied as an `ArrayBuffer` containing the raw bytes for the key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index c7cdac8c62..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use [HMAC](#hmac), pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - -### HMAC - -The HMAC algorithm calculates and verifies hash-based message authentication codes according to the -[FIPS 198-1 standard](https://csrc.nist.gov/csrc/media/publications/fips/198/1/final/documents/fips-198-1_final.pdf). - -The digest algorithm to use is specified in the -[`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object -that you pass into [`SubtleCrypto.importKey()`](./importKey.mdx). diff --git a/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index df9d338369..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use HMAC, pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-3.2.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-3.2.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-3.2.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-3.2.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-3.2.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-3.2.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-3.2.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.2.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-3.2.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-3.2.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.2.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.2.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.2.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-3.2.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-3.2.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.2.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-3.2.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-3.2.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-3.2.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.2.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-3.2.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.2.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-3.2.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-3.2.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-3.2.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-3.2.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-3.2.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-3.2.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-3.2.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-3.2.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.2.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-3.2.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-3.2.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-3.2.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.2.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-3.2.0/globals/atob.mdx b/documentation/versioned_docs/version-3.2.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-3.2.0/globals/btoa.mdx b/documentation/versioned_docs/version-3.2.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-3.2.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-3.2.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-3.2.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/assert.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/clear.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/count.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/count.mdx deleted file mode 100644 index ea8b92a0d4..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` _optional_ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/debug.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/dir.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/error.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/group.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/info.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/log.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/time.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/trace.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/console/warn.mdx b/documentation/versioned_docs/version-3.2.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-3.2.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-3.2.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-3.2.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-3.2.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-3.2.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-3.2.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-3.2.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-3.2.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-3.2.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-3.2.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/escape.mdx b/documentation/versioned_docs/version-3.2.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-3.2.0/globals/eval.mdx b/documentation/versioned_docs/version-3.2.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-3.2.0/globals/globalThis.mdx b/documentation/versioned_docs/version-3.2.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-3.2.0/globals/isFinite.mdx b/documentation/versioned_docs/version-3.2.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/isNaN.mdx b/documentation/versioned_docs/version-3.2.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-3.2.0/globals/location.mdx b/documentation/versioned_docs/version-3.2.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-3.2.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-3.2.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-3.2.0/globals/parseInt.mdx b/documentation/versioned_docs/version-3.2.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/performance/now.mdx b/documentation/versioned_docs/version-3.2.0/globals/performance/now.mdx deleted file mode 100644 index da8f617cb9..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/performance/now.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.now() - -The **`performance.now()`** method returns a high resolution timestamp in milliseconds. -It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated). - -## Syntax - -```js -now() -``` - -### Parameters - -None. - -### Return value - -Returns a number which represents the time since worker instantation measured in milliseconds. diff --git a/documentation/versioned_docs/version-3.2.0/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-3.2.0/globals/performance/timeOrigin.mdx deleted file mode 100644 index 772a527822..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/performance/timeOrigin.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.timeOrigin - -The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps. - -This value represents the time when the worker was instantiated. - -### Value - -Returns a number which represents the time when the worker was instantation. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.2.0/globals/setInterval.mdx b/documentation/versioned_docs/version-3.2.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-3.2.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-3.2.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-3.2.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-3.2.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-3.2.0/globals/undefined.mdx b/documentation/versioned_docs/version-3.2.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-3.2.0/globals/unescape.mdx b/documentation/versioned_docs/version-3.2.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-3.2.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-3.2.0/index.mdx b/documentation/versioned_docs/version-3.2.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-3.2.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-3.2.0/migration-guide/index.mdx b/documentation/versioned_docs/version-3.2.0/migration-guide/index.mdx deleted file mode 100644 index 543d0432cd..0000000000 --- a/documentation/versioned_docs/version-3.2.0/migration-guide/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# `Migrating from v2 to v3` - -## SimpleCache.delete renamed to SimpleCache.purge and requires purge options to be supplied as the second parameter - -We are renaming because "purge" is already a well-known and documented concept for removing content from Fastly's cache. - -The new addition of a second argument allows the caller to decide what scope to purge the content from, currently they can choose to purge from all of Fastly ("global") or from the POP that contains the currently executing instance ("pop"). We do not provide a default option right now, in the future we may provide a default option, if we discover a common pattern is being used. - -Here is an example of migrating an application using `SimpleCache.delete` to `SimpleCache.purge` with the same purging behaviour: -```diff -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request); - const path = url.pathname; - if (url.searchParams.has('delete')) { -- SimpleCache.delete(path); -+ SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - - -``` - - -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-3.3.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index fffeca92b7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,227 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `dontPool` _: boolean_ _**optional**_ - - Determine whether or not connections to the same backend should be pooled across different sessions. - - Fastly considers two backends “the same” if they're registered with the same name and the exact same settings. - - In those cases, when pooling is enabled, if Session 1 opens a connection to this backend it will be left open, and can be re-used by Session 2. - - This can help improve backend latency, by removing the need for the initial network / TLS handshake(s). - - By default, pooling is enabled for dynamic backends. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-3.3.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index 8803456915..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, and return a message stating whether the entry was in the Fastly Cache or not. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - return new Response(page ? `${path} is in the cache` : `${path} is not in the cache`, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index a15a22dc09..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key` if no entry is found (or has expired), the supplied `set` function is executed and it's result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - : A function to execute when the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. - - `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/purge.mdx b/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/purge.mdx deleted file mode 100644 index 44ac6ff92c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCache/purge.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# SimpleCache.purge - -purge the entry associated with the key `key` from the cache. - -## Syntax - -```js -purge(key, options) -``` - -### Parameters - -- `key` _: string_ - - The key to purge from within the cache. - -- `options` _: object_ - - `scope` _: string_ - - : Where to purge the content from. - - Possible values are: - - "global" - This will remove the content from all of Fastly. - - "pop" - This will remove the content from the POP that contains the currently executing instance. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `purge` querystring parameter, we purge the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('purge')) { - SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-3.3.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-3.3.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-3.3.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-3.3.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-3.3.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:env/env.mdx b/documentation/versioned_docs/version-3.3.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.3.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-3.3.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-3.3.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-3.3.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-3.3.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-3.3.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index cd63199613..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/kv-stores/#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-3.3.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-3.3.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-3.3.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.3.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-3.3.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.3.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-3.3.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-3.3.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-3.3.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/from.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/of.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-3.3.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-3.3.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-3.3.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.3.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-3.3.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.3.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.3.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-3.3.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-3.3.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-3.3.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-3.3.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-3.3.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-3.3.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-3.3.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-3.3.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.3.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.3.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.3.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DOMException/DOMException.mdx b/documentation/versioned_docs/version-3.3.0/globals/DOMException/DOMException.mdx deleted file mode 100644 index 160e40e774..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DOMException/DOMException.mdx +++ /dev/null @@ -1,107 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException() - -The **`DOMException()`** constructor returns a `DOMException` object with a specified message and name. - -## Syntax - -```js -new DOMException() -new DOMException(message) -new DOMException(message, name) -``` - -### Parameters - -- `message` _optional_ - - : A description of the exception. If not present, the empty string `''` is - used. -- `name` _optional_ - - : A string. If the specified name is a [standard error name](#error-names), then getting the [`code`](./code.mdx) property of the `DOMException` object will return the code number corresponding to the specified name. - -### Return value - -A newly created `DOMException` object. - -## Error names - -Common error names are listed here. Some APIs define their own sets of names, so this is not necessarily a complete list. - -Note that the following deprecated historical errors don't have an error name but instead have only a legacy constant code value and a legacy constant name: - -- Legacy code value: `2`, legacy constant name: `DOMSTRING_SIZE_ERR` -- Legacy code value: `6`, legacy constant name: `NO_DATA_ALLOWED_ERR` -- Legacy code value: `16`, legacy constant name: `VALIDATION_ERR` - -> **Note:** Because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past. - -- `IndexSizeError` - - : The index is not in the allowed range. (Legacy code value: `1` and legacy constant name: `INDEX_SIZE_ERR`) -- `HierarchyRequestError` - - : The node tree hierarchy is not correct. (Legacy code value: `3` and legacy constant name: `HIERARCHY_REQUEST_ERR`) -- `WrongDocumentError` - - : The object is in the wrong `Document`. (Legacy code value: `4` and legacy constant name: `WRONG_DOCUMENT_ERR`) -- `InvalidCharacterError` - - : The string contains invalid characters. (Legacy code value: `5` and legacy constant name: `INVALID_CHARACTER_ERR`) -- `NoModificationAllowedError` - - : The object cannot be modified. (Legacy code value: `7` and legacy constant name: `NO_MODIFICATION_ALLOWED_ERR`) -- `NotFoundError` - - : The object cannot be found here. (Legacy code value: `8` and legacy constant name: `NOT_FOUND_ERR`) -- `NotSupportedError` - - : The operation is not supported. (Legacy code value: `9` and legacy constant name: `NOT_SUPPORTED_ERR`) -- `InvalidStateError` - - : The object is in an invalid state. (Legacy code value: `11` and legacy constant name: `INVALID_STATE_ERR`) -- `InUseAttributeError` - - : The attribute is in use. (Legacy code value: `10` and legacy constant name: `INUSE_ATTRIBUTE_ERR`) -- `SyntaxError` - - : The string did not match the expected pattern. (Legacy code value: `12` and legacy constant name: `SYNTAX_ERR`) -- `InvalidModificationError` - - : The object cannot be modified in this way. (Legacy code value: `13` and legacy constant name: `INVALID_MODIFICATION_ERR`) -- `NamespaceError` - - : The operation is not allowed by Namespaces in XML. (Legacy code value: `14` and legacy constant name: `NAMESPACE_ERR`) -- `InvalidAccessError` - - : The object does not support the operation or argument. (Legacy code value: `15` and legacy constant name: `INVALID_ACCESS_ERR`) -- `TypeMismatchError` *deprecated* - - : The type of the object does not match the expected type. (Legacy code value: `17` and legacy constant name: `TYPE_MISMATCH_ERR`) This value is deprecated; the JavaScript `TypeError` exception is now raised instead of a `DOMException` with this value. -- `SecurityError` - - : The operation is insecure. (Legacy code value: `18` and legacy constant name: `SECURITY_ERR`) -- `NetworkError` - - : A network error occurred. (Legacy code value: `19` and legacy constant name: `NETWORK_ERR`) -- `AbortError` - - : The operation was aborted. (Legacy code value: `20` and legacy constant name: `ABORT_ERR`) -- `URLMismatchError` - - : The given URL does not match another URL. (Legacy code value: `21` and legacy constant name: `URL_MISMATCH_ERR`) -- `QuotaExceededError` - - : The quota has been exceeded. (Legacy code value: `22` and legacy constant name: `QUOTA_EXCEEDED_ERR`) -- `TimeoutError` - - : The operation timed out. (Legacy code value: `23` and legacy constant name: `TIMEOUT_ERR`) -- `InvalidNodeTypeError` - - : The node is incorrect or has an incorrect ancestor for this operation. (Legacy code value: `24` and legacy constant name: `INVALID_NODE_TYPE_ERR`) -- `DataCloneError` - - : The object can not be cloned. (Legacy code value: `25` and legacy constant name: `DATA_CLONE_ERR`) -- `EncodingError` - - : The encoding or decoding operation failed (No legacy code value and constant name). -- `NotReadableError` - - : The input/output read operation failed (No legacy code value and constant name). -- `UnknownError` - - : The operation failed for an unknown transient reason (e.g. out of memory) (No legacy code value and constant name). -- `ConstraintError` - - : A mutation operation in a transaction failed because a constraint was not satisfied (No legacy code value and constant name). -- `DataError` - - : Provided data is inadequate (No legacy code value and constant name). -- `TransactionInactiveError` - - : A request was placed against a transaction that is currently not active or is finished (No legacy code value and constant name). -- `ReadOnlyError` - - : The mutating operation was attempted in a "readonly" transaction (No legacy code value and constant name). -- `VersionError` - - : An attempt was made to open a database using a lower version than the existing version (No legacy code value and constant name). -- `OperationError` - - : The operation failed for an operation-specific reason (No legacy code value and constant name). -- `NotAllowedError` - - : The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (No legacy code value and constant name). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/globals/DOMException/code.mdx b/documentation/versioned_docs/version-3.3.0/globals/DOMException/code.mdx deleted file mode 100644 index 21b9836fa4..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DOMException/code.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.code - -The **`code`** read-only property of the `DOMException` interface returns one of the legacy [error code constants](./DOMException.mdx#error-names), or `0` if none match. - -This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the [`name`](./name.mdx) attribute. - -## Value - -One of the [error code constants](./DOMException.mdx#error-names), or `0` if none match. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DOMException/message.mdx b/documentation/versioned_docs/version-3.3.0/globals/DOMException/message.mdx deleted file mode 100644 index 44d3c6b8da..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DOMException/message.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.message - -The **`message`** read-only property of the `DOMException` interface returns a string representing a message or description associated with the given [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DOMException/name.mdx b/documentation/versioned_docs/version-3.3.0/globals/DOMException/name.mdx deleted file mode 100644 index 1dda11b92c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DOMException/name.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.name - -The **`name`** read-only property of the `DOMException` interface returns a string that contains one of the strings associated with an [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/now.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-3.3.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.3.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.3.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-3.3.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-3.3.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-3.3.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-3.3.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-3.3.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-3.3.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-3.3.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-3.3.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-3.3.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-3.3.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-3.3.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-3.3.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-3.3.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-3.3.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-3.3.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-3.3.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-3.3.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.3.0/globals/HmacImportParams/HmacImportParams.mdx b/documentation/versioned_docs/version-3.3.0/globals/HmacImportParams/HmacImportParams.mdx deleted file mode 100644 index 816aa2e7dc..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/HmacImportParams/HmacImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# HmacImportParams - -The **`HmacImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey`, when generating a key for the `HMAC` algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `HMAC`. -- `hash` - - - : A string representing the name of the digest function to use. The can take a value of `SHA-1`, `SHA-256`, `SHA-384`, or `SHA-512`. - -- `length` _optional_ - - : A `Number` representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/Infinity.mdx b/documentation/versioned_docs/version-3.3.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-3.3.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-3.3.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-3.3.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-3.3.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-3.3.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-3.3.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-3.3.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-3.3.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/E.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/log.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/max.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/min.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/random.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/round.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-3.3.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/NaN.mdx b/documentation/versioned_docs/version-3.3.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/create.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/is.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Object/values.mdx b/documentation/versioned_docs/version-3.3.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-3.3.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-3.3.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-3.3.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-3.3.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-3.3.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-3.3.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-3.3.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-3.3.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-3.3.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-3.3.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-3.3.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-3.3.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-3.3.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-3.3.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-3.3.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-3.3.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-3.3.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-3.3.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-3.3.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-3.3.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.3.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-3.3.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-3.3.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-3.3.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-3.3.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-3.3.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-3.3.0/globals/Request/Request.mdx deleted file mode 100644 index 81af5a46cf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Request/Request.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-3.3.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-3.3.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-3.3.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-3.3.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 3477966947..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-3.3.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-3.3.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/String.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.3.0/globals/String/raw.mdx b/documentation/versioned_docs/version-3.3.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 1e17f6d925..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `raw`: [Raw](#raw) format. - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. - - For HMAC: - Pass an [`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - -### Raw - -You can use this format to import or export AES or HMAC secret keys, or Elliptic Curve -public keys. - -In this format the key is supplied as an `ArrayBuffer` containing the raw bytes for the key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index c7cdac8c62..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use [HMAC](#hmac), pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - -### HMAC - -The HMAC algorithm calculates and verifies hash-based message authentication codes according to the -[FIPS 198-1 standard](https://csrc.nist.gov/csrc/media/publications/fips/198/1/final/documents/fips-198-1_final.pdf). - -The digest algorithm to use is specified in the -[`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object -that you pass into [`SubtleCrypto.importKey()`](./importKey.mdx). diff --git a/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index df9d338369..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use HMAC, pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-3.3.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-3.3.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-3.3.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-3.3.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-3.3.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-3.3.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-3.3.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.3.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-3.3.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-3.3.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.3.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.3.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.3.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-3.3.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-3.3.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.3.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-3.3.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-3.3.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-3.3.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-3.3.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-3.3.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-3.3.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-3.3.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-3.3.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-3.3.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-3.3.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-3.3.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-3.3.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.3.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-3.3.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-3.3.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-3.3.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.3.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-3.3.0/globals/atob.mdx b/documentation/versioned_docs/version-3.3.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-3.3.0/globals/btoa.mdx b/documentation/versioned_docs/version-3.3.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-3.3.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-3.3.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-3.3.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/assert.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/clear.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/count.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/count.mdx deleted file mode 100644 index ea8b92a0d4..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` _optional_ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/debug.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/dir.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/error.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/group.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/info.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/log.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/time.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/trace.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/console/warn.mdx b/documentation/versioned_docs/version-3.3.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-3.3.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-3.3.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-3.3.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-3.3.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-3.3.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-3.3.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-3.3.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-3.3.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-3.3.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-3.3.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/escape.mdx b/documentation/versioned_docs/version-3.3.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-3.3.0/globals/eval.mdx b/documentation/versioned_docs/version-3.3.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-3.3.0/globals/fetch.mdx b/documentation/versioned_docs/version-3.3.0/globals/fetch.mdx deleted file mode 100644 index 32581670e4..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/fetch.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/globalThis.mdx b/documentation/versioned_docs/version-3.3.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-3.3.0/globals/isFinite.mdx b/documentation/versioned_docs/version-3.3.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/isNaN.mdx b/documentation/versioned_docs/version-3.3.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-3.3.0/globals/location.mdx b/documentation/versioned_docs/version-3.3.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-3.3.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-3.3.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-3.3.0/globals/parseInt.mdx b/documentation/versioned_docs/version-3.3.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/performance/now.mdx b/documentation/versioned_docs/version-3.3.0/globals/performance/now.mdx deleted file mode 100644 index da8f617cb9..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/performance/now.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.now() - -The **`performance.now()`** method returns a high resolution timestamp in milliseconds. -It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated). - -## Syntax - -```js -now() -``` - -### Parameters - -None. - -### Return value - -Returns a number which represents the time since worker instantation measured in milliseconds. diff --git a/documentation/versioned_docs/version-3.3.0/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-3.3.0/globals/performance/timeOrigin.mdx deleted file mode 100644 index 772a527822..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/performance/timeOrigin.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.timeOrigin - -The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps. - -This value represents the time when the worker was instantiated. - -### Value - -Returns a number which represents the time when the worker was instantation. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.0/globals/setInterval.mdx b/documentation/versioned_docs/version-3.3.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-3.3.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-3.3.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-3.3.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-3.3.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-3.3.0/globals/undefined.mdx b/documentation/versioned_docs/version-3.3.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-3.3.0/globals/unescape.mdx b/documentation/versioned_docs/version-3.3.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-3.3.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-3.3.0/index.mdx b/documentation/versioned_docs/version-3.3.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-3.3.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-3.3.0/migration-guide/index.mdx b/documentation/versioned_docs/version-3.3.0/migration-guide/index.mdx deleted file mode 100644 index 543d0432cd..0000000000 --- a/documentation/versioned_docs/version-3.3.0/migration-guide/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# `Migrating from v2 to v3` - -## SimpleCache.delete renamed to SimpleCache.purge and requires purge options to be supplied as the second parameter - -We are renaming because "purge" is already a well-known and documented concept for removing content from Fastly's cache. - -The new addition of a second argument allows the caller to decide what scope to purge the content from, currently they can choose to purge from all of Fastly ("global") or from the POP that contains the currently executing instance ("pop"). We do not provide a default option right now, in the future we may provide a default option, if we discover a common pattern is being used. - -Here is an example of migrating an application using `SimpleCache.delete` to `SimpleCache.purge` with the same purging behaviour: -```diff -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request); - const path = url.pathname; - if (url.searchParams.has('delete')) { -- SimpleCache.delete(path); -+ SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - - -``` - - -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-3.3.2/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index fffeca92b7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,227 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `dontPool` _: boolean_ _**optional**_ - - Determine whether or not connections to the same backend should be pooled across different sessions. - - Fastly considers two backends “the same” if they're registered with the same name and the exact same settings. - - In those cases, when pooling is enabled, if Session 1 opens a connection to this backend it will be left open, and can be re-used by Session 2. - - This can help improve backend latency, by removing the need for the initial network / TLS handshake(s). - - By default, pooling is enabled for dynamic backends. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.2/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-3.3.2/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index 8803456915..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, and return a message stating whether the entry was in the Fastly Cache or not. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - return new Response(page ? `${path} is in the cache` : `${path} is not in the cache`, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index a15a22dc09..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key` if no entry is found (or has expired), the supplied `set` function is executed and it's result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - : A function to execute when the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. - - `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/purge.mdx b/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/purge.mdx deleted file mode 100644 index 44ac6ff92c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCache/purge.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# SimpleCache.purge - -purge the entry associated with the key `key` from the cache. - -## Syntax - -```js -purge(key, options) -``` - -### Parameters - -- `key` _: string_ - - The key to purge from within the cache. - -- `options` _: object_ - - `scope` _: string_ - - : Where to purge the content from. - - Possible values are: - - "global" - This will remove the content from all of Fastly. - - "pop" - This will remove the content from the POP that contains the currently executing instance. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `purge` querystring parameter, we purge the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('purge')) { - SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-3.3.2/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-3.3.2/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-3.3.2/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-3.3.2/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-3.3.2/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:env/env.mdx b/documentation/versioned_docs/version-3.3.2/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.3.2/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-3.3.2/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-3.3.2/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-3.3.2/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-3.3.2/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-3.3.2/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index cd63199613..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/kv-stores/#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-3.3.2/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-3.3.2/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-3.3.2/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.3.2/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-3.3.2/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.3.2/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-3.3.2/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-3.3.2/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-3.3.2/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/@@species.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/Array.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/from.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/isArray.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/of.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-3.3.2/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-3.3.2/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-3.3.2/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.3.2/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-3.3.2/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.3.2/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.3.2/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-3.3.2/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.2/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-3.3.2/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.2/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-3.3.2/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-3.3.2/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-3.3.2/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-3.3.2/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-3.3.2/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-3.3.2/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.3.2/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.3.2/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.3.2/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DOMException/DOMException.mdx b/documentation/versioned_docs/version-3.3.2/globals/DOMException/DOMException.mdx deleted file mode 100644 index 160e40e774..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DOMException/DOMException.mdx +++ /dev/null @@ -1,107 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException() - -The **`DOMException()`** constructor returns a `DOMException` object with a specified message and name. - -## Syntax - -```js -new DOMException() -new DOMException(message) -new DOMException(message, name) -``` - -### Parameters - -- `message` _optional_ - - : A description of the exception. If not present, the empty string `''` is - used. -- `name` _optional_ - - : A string. If the specified name is a [standard error name](#error-names), then getting the [`code`](./code.mdx) property of the `DOMException` object will return the code number corresponding to the specified name. - -### Return value - -A newly created `DOMException` object. - -## Error names - -Common error names are listed here. Some APIs define their own sets of names, so this is not necessarily a complete list. - -Note that the following deprecated historical errors don't have an error name but instead have only a legacy constant code value and a legacy constant name: - -- Legacy code value: `2`, legacy constant name: `DOMSTRING_SIZE_ERR` -- Legacy code value: `6`, legacy constant name: `NO_DATA_ALLOWED_ERR` -- Legacy code value: `16`, legacy constant name: `VALIDATION_ERR` - -> **Note:** Because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past. - -- `IndexSizeError` - - : The index is not in the allowed range. (Legacy code value: `1` and legacy constant name: `INDEX_SIZE_ERR`) -- `HierarchyRequestError` - - : The node tree hierarchy is not correct. (Legacy code value: `3` and legacy constant name: `HIERARCHY_REQUEST_ERR`) -- `WrongDocumentError` - - : The object is in the wrong `Document`. (Legacy code value: `4` and legacy constant name: `WRONG_DOCUMENT_ERR`) -- `InvalidCharacterError` - - : The string contains invalid characters. (Legacy code value: `5` and legacy constant name: `INVALID_CHARACTER_ERR`) -- `NoModificationAllowedError` - - : The object cannot be modified. (Legacy code value: `7` and legacy constant name: `NO_MODIFICATION_ALLOWED_ERR`) -- `NotFoundError` - - : The object cannot be found here. (Legacy code value: `8` and legacy constant name: `NOT_FOUND_ERR`) -- `NotSupportedError` - - : The operation is not supported. (Legacy code value: `9` and legacy constant name: `NOT_SUPPORTED_ERR`) -- `InvalidStateError` - - : The object is in an invalid state. (Legacy code value: `11` and legacy constant name: `INVALID_STATE_ERR`) -- `InUseAttributeError` - - : The attribute is in use. (Legacy code value: `10` and legacy constant name: `INUSE_ATTRIBUTE_ERR`) -- `SyntaxError` - - : The string did not match the expected pattern. (Legacy code value: `12` and legacy constant name: `SYNTAX_ERR`) -- `InvalidModificationError` - - : The object cannot be modified in this way. (Legacy code value: `13` and legacy constant name: `INVALID_MODIFICATION_ERR`) -- `NamespaceError` - - : The operation is not allowed by Namespaces in XML. (Legacy code value: `14` and legacy constant name: `NAMESPACE_ERR`) -- `InvalidAccessError` - - : The object does not support the operation or argument. (Legacy code value: `15` and legacy constant name: `INVALID_ACCESS_ERR`) -- `TypeMismatchError` *deprecated* - - : The type of the object does not match the expected type. (Legacy code value: `17` and legacy constant name: `TYPE_MISMATCH_ERR`) This value is deprecated; the JavaScript `TypeError` exception is now raised instead of a `DOMException` with this value. -- `SecurityError` - - : The operation is insecure. (Legacy code value: `18` and legacy constant name: `SECURITY_ERR`) -- `NetworkError` - - : A network error occurred. (Legacy code value: `19` and legacy constant name: `NETWORK_ERR`) -- `AbortError` - - : The operation was aborted. (Legacy code value: `20` and legacy constant name: `ABORT_ERR`) -- `URLMismatchError` - - : The given URL does not match another URL. (Legacy code value: `21` and legacy constant name: `URL_MISMATCH_ERR`) -- `QuotaExceededError` - - : The quota has been exceeded. (Legacy code value: `22` and legacy constant name: `QUOTA_EXCEEDED_ERR`) -- `TimeoutError` - - : The operation timed out. (Legacy code value: `23` and legacy constant name: `TIMEOUT_ERR`) -- `InvalidNodeTypeError` - - : The node is incorrect or has an incorrect ancestor for this operation. (Legacy code value: `24` and legacy constant name: `INVALID_NODE_TYPE_ERR`) -- `DataCloneError` - - : The object can not be cloned. (Legacy code value: `25` and legacy constant name: `DATA_CLONE_ERR`) -- `EncodingError` - - : The encoding or decoding operation failed (No legacy code value and constant name). -- `NotReadableError` - - : The input/output read operation failed (No legacy code value and constant name). -- `UnknownError` - - : The operation failed for an unknown transient reason (e.g. out of memory) (No legacy code value and constant name). -- `ConstraintError` - - : A mutation operation in a transaction failed because a constraint was not satisfied (No legacy code value and constant name). -- `DataError` - - : Provided data is inadequate (No legacy code value and constant name). -- `TransactionInactiveError` - - : A request was placed against a transaction that is currently not active or is finished (No legacy code value and constant name). -- `ReadOnlyError` - - : The mutating operation was attempted in a "readonly" transaction (No legacy code value and constant name). -- `VersionError` - - : An attempt was made to open a database using a lower version than the existing version (No legacy code value and constant name). -- `OperationError` - - : The operation failed for an operation-specific reason (No legacy code value and constant name). -- `NotAllowedError` - - : The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (No legacy code value and constant name). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/globals/DOMException/code.mdx b/documentation/versioned_docs/version-3.3.2/globals/DOMException/code.mdx deleted file mode 100644 index 21b9836fa4..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DOMException/code.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.code - -The **`code`** read-only property of the `DOMException` interface returns one of the legacy [error code constants](./DOMException.mdx#error-names), or `0` if none match. - -This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the [`name`](./name.mdx) attribute. - -## Value - -One of the [error code constants](./DOMException.mdx#error-names), or `0` if none match. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DOMException/message.mdx b/documentation/versioned_docs/version-3.3.2/globals/DOMException/message.mdx deleted file mode 100644 index 44d3c6b8da..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DOMException/message.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.message - -The **`message`** read-only property of the `DOMException` interface returns a string representing a message or description associated with the given [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DOMException/name.mdx b/documentation/versioned_docs/version-3.3.2/globals/DOMException/name.mdx deleted file mode 100644 index 1dda11b92c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DOMException/name.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.name - -The **`name`** read-only property of the `DOMException` interface returns a string that contains one of the strings associated with an [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/Date.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/UTC.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/now.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/parse.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-3.3.2/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.3.2/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.3.2/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Error/Error.mdx b/documentation/versioned_docs/version-3.3.2/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-3.3.2/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-3.3.2/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-3.3.2/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-3.3.2/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-3.3.2/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.2/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-3.3.2/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 6cd2c5ec1d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - - `FetchEvent.client.tlsJA3MD5` _**readonly**_ - - : A string representation of the JA3 hash of the TLS ClientHello message. - - `FetchEvent.client.tlsCipherOpensslName` _**readonly**_ - - : A string representation of the cipher suite used to secure the client TLS connection. - - `FetchEvent.client.tlsProtocol` _**readonly**_ - - : A string representation of the TLS protocol version used to secure the client TLS connection. - - `FetchEvent.client.tlsClientCertificate` _**readonly**_ - - : An ArrayBuffer containing the raw client certificate in the mutual TLS handshake message. It is in PEM format. Returns an empty ArrayBuffer if this is not mTLS or available. - - `FetchEvent.client.tlsClientHello` _**readonly**_ - - : An ArrayBuffer containing the raw bytes sent by the client in the TLS ClientHello message. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-3.3.2/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-3.3.2/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-3.3.2/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-3.3.2/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-3.3.2/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-3.3.2/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-3.3.2/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-3.3.2/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-3.3.2/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-3.3.2/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Function/Function.mdx b/documentation/versioned_docs/version-3.3.2/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-3.3.2/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.3.2/globals/HmacImportParams/HmacImportParams.mdx b/documentation/versioned_docs/version-3.3.2/globals/HmacImportParams/HmacImportParams.mdx deleted file mode 100644 index 816aa2e7dc..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/HmacImportParams/HmacImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# HmacImportParams - -The **`HmacImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey`, when generating a key for the `HMAC` algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `HMAC`. -- `hash` - - - : A string representing the name of the digest function to use. The can take a value of `SHA-1`, `SHA-256`, `SHA-384`, or `SHA-512`. - -- `length` _optional_ - - : A `Number` representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/Infinity.mdx b/documentation/versioned_docs/version-3.3.2/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-3.3.2/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-3.3.2/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-3.3.2/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.2/globals/JSON/parse.mdx b/documentation/versioned_docs/version-3.3.2/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-3.3.2/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-3.3.2/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Map/@@species.mdx b/documentation/versioned_docs/version-3.3.2/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Map/Map.mdx b/documentation/versioned_docs/version-3.3.2/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/E.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/LN10.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/LN2.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/PI.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/abs.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/acos.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/acosh.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/asin.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/asinh.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/atan.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/atan2.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/atanh.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/ceil.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/clz32.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/cos.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/cosh.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/exp.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/expm1.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/floor.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/fround.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/hypot.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/imul.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/log.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/log10.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/log1p.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/log2.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/max.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/min.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/pow.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/random.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/round.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/sign.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/sin.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/sinh.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/tan.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/tanh.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Math/trunc.mdx b/documentation/versioned_docs/version-3.3.2/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/NaN.mdx b/documentation/versioned_docs/version-3.3.2/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/NaN.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/Number.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/Object.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/assign.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/create.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/entries.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/freeze.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/is.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/keys.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/seal.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Object/values.mdx b/documentation/versioned_docs/version-3.3.2/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-3.3.2/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-3.3.2/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Promise/all.mdx b/documentation/versioned_docs/version-3.3.2/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-3.3.2/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Promise/any.mdx b/documentation/versioned_docs/version-3.3.2/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-3.3.2/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-3.3.2/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-3.3.2/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Promise/race.mdx b/documentation/versioned_docs/version-3.3.2/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Promise/reject.mdx b/documentation/versioned_docs/version-3.3.2/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-3.3.2/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-3.3.2/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-3.3.2/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-3.3.2/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-3.3.2/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-3.3.2/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-3.3.2/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-3.3.2/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-3.3.2/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Reflect/get.mdx b/documentation/versioned_docs/version-3.3.2/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.3.2/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Reflect/has.mdx b/documentation/versioned_docs/version-3.3.2/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-3.3.2/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-3.3.2/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-3.3.2/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Reflect/set.mdx b/documentation/versioned_docs/version-3.3.2/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/Request/Request.mdx b/documentation/versioned_docs/version-3.3.2/globals/Request/Request.mdx deleted file mode 100644 index 81af5a46cf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Request/Request.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/Response/Response.mdx b/documentation/versioned_docs/version-3.3.2/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/Response/redirect.mdx b/documentation/versioned_docs/version-3.3.2/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-3.3.2/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-3.3.2/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 3477966947..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/Set/@@species.mdx b/documentation/versioned_docs/version-3.3.2/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Set/Set.mdx b/documentation/versioned_docs/version-3.3.2/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/String.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.3.2/globals/String/raw.mdx b/documentation/versioned_docs/version-3.3.2/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 1e17f6d925..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `raw`: [Raw](#raw) format. - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. - - For HMAC: - Pass an [`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - -### Raw - -You can use this format to import or export AES or HMAC secret keys, or Elliptic Curve -public keys. - -In this format the key is supplied as an `ArrayBuffer` containing the raw bytes for the key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index c7cdac8c62..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use [HMAC](#hmac), pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - -### HMAC - -The HMAC algorithm calculates and verifies hash-based message authentication codes according to the -[FIPS 198-1 standard](https://csrc.nist.gov/csrc/media/publications/fips/198/1/final/documents/fips-198-1_final.pdf). - -The digest algorithm to use is specified in the -[`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object -that you pass into [`SubtleCrypto.importKey()`](./importKey.mdx). diff --git a/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index df9d338369..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use HMAC, pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/for.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/match.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/search.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/species.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/split.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-3.3.2/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-3.3.2/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-3.3.2/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-3.3.2/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-3.3.2/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-3.3.2/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-3.3.2/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.3.2/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-3.3.2/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-3.3.2/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.3.2/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.3.2/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.3.2/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-3.3.2/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-3.3.2/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/URL.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.3.2/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-3.3.2/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-3.3.2/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-3.3.2/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.2/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-3.3.2/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.3.2/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-3.3.2/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-3.3.2/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-3.3.2/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-3.3.2/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-3.3.2/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-3.3.2/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-3.3.2/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-3.3.2/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.3.2/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-3.3.2/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-3.3.2/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-3.3.2/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.3.2/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-3.3.2/globals/atob.mdx b/documentation/versioned_docs/version-3.3.2/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-3.3.2/globals/btoa.mdx b/documentation/versioned_docs/version-3.3.2/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-3.3.2/globals/clearInterval.mdx b/documentation/versioned_docs/version-3.3.2/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/clearTimeout.mdx b/documentation/versioned_docs/version-3.3.2/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/assert.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/clear.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/count.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/count.mdx deleted file mode 100644 index ea8b92a0d4..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` _optional_ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/countReset.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/debug.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/dir.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/dirxml.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/error.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/group.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/info.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/log.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/time.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/timeLog.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/trace.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/console/warn.mdx b/documentation/versioned_docs/version-3.3.2/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-3.3.2/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-3.3.2/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-3.3.2/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-3.3.2/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-3.3.2/globals/decodeURI.mdx b/documentation/versioned_docs/version-3.3.2/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-3.3.2/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/encodeURI.mdx b/documentation/versioned_docs/version-3.3.2/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-3.3.2/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-3.3.2/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/escape.mdx b/documentation/versioned_docs/version-3.3.2/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-3.3.2/globals/eval.mdx b/documentation/versioned_docs/version-3.3.2/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-3.3.2/globals/fetch.mdx b/documentation/versioned_docs/version-3.3.2/globals/fetch.mdx deleted file mode 100644 index 32581670e4..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/fetch.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/globalThis.mdx b/documentation/versioned_docs/version-3.3.2/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-3.3.2/globals/isFinite.mdx b/documentation/versioned_docs/version-3.3.2/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/isNaN.mdx b/documentation/versioned_docs/version-3.3.2/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-3.3.2/globals/location.mdx b/documentation/versioned_docs/version-3.3.2/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-3.3.2/globals/parseFloat.mdx b/documentation/versioned_docs/version-3.3.2/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-3.3.2/globals/parseInt.mdx b/documentation/versioned_docs/version-3.3.2/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/performance/now.mdx b/documentation/versioned_docs/version-3.3.2/globals/performance/now.mdx deleted file mode 100644 index da8f617cb9..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/performance/now.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.now() - -The **`performance.now()`** method returns a high resolution timestamp in milliseconds. -It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated). - -## Syntax - -```js -now() -``` - -### Parameters - -None. - -### Return value - -Returns a number which represents the time since worker instantation measured in milliseconds. diff --git a/documentation/versioned_docs/version-3.3.2/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-3.3.2/globals/performance/timeOrigin.mdx deleted file mode 100644 index 772a527822..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/performance/timeOrigin.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.timeOrigin - -The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps. - -This value represents the time when the worker was instantiated. - -### Value - -Returns a number which represents the time when the worker was instantation. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.3.2/globals/setInterval.mdx b/documentation/versioned_docs/version-3.3.2/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-3.3.2/globals/setTimeout.mdx b/documentation/versioned_docs/version-3.3.2/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-3.3.2/globals/structuredClone.mdx b/documentation/versioned_docs/version-3.3.2/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-3.3.2/globals/undefined.mdx b/documentation/versioned_docs/version-3.3.2/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-3.3.2/globals/unescape.mdx b/documentation/versioned_docs/version-3.3.2/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-3.3.2/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-3.3.2/index.mdx b/documentation/versioned_docs/version-3.3.2/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-3.3.2/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-3.3.2/migration-guide/index.mdx b/documentation/versioned_docs/version-3.3.2/migration-guide/index.mdx deleted file mode 100644 index 543d0432cd..0000000000 --- a/documentation/versioned_docs/version-3.3.2/migration-guide/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# `Migrating from v2 to v3` - -## SimpleCache.delete renamed to SimpleCache.purge and requires purge options to be supplied as the second parameter - -We are renaming because "purge" is already a well-known and documented concept for removing content from Fastly's cache. - -The new addition of a second argument allows the caller to decide what scope to purge the content from, currently they can choose to purge from all of Fastly ("global") or from the POP that contains the currently executing instance ("pop"). We do not provide a default option right now, in the future we may provide a default option, if we discover a common pattern is being used. - -Here is an example of migrating an application using `SimpleCache.delete` to `SimpleCache.purge` with the same purging behaviour: -```diff -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request); - const path = url.pathname; - if (url.searchParams.has('delete')) { -- SimpleCache.delete(path); -+ SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - - -``` - - -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-3.4.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index fffeca92b7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,227 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `dontPool` _: boolean_ _**optional**_ - - Determine whether or not connections to the same backend should be pooled across different sessions. - - Fastly considers two backends “the same” if they're registered with the same name and the exact same settings. - - In those cases, when pooling is enabled, if Session 1 opens a connection to this backend it will be left open, and can be re-used by Session 2. - - This can help improve backend latency, by removing the need for the initial network / TLS handshake(s). - - By default, pooling is enabled for dynamic backends. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-3.4.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-3.4.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index a15a22dc09..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key` if no entry is found (or has expired), the supplied `set` function is executed and it's result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - : A function to execute when the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. - - `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/purge.mdx b/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/purge.mdx deleted file mode 100644 index 44ac6ff92c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCache/purge.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# SimpleCache.purge - -purge the entry associated with the key `key` from the cache. - -## Syntax - -```js -purge(key, options) -``` - -### Parameters - -- `key` _: string_ - - The key to purge from within the cache. - -- `options` _: object_ - - `scope` _: string_ - - : Where to purge the content from. - - Possible values are: - - "global" - This will remove the content from all of Fastly. - - "pop" - This will remove the content from the POP that contains the currently executing instance. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `purge` querystring parameter, we purge the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('purge')) { - SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-3.4.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-3.4.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-3.4.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-3.4.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-3.4.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:env/env.mdx b/documentation/versioned_docs/version-3.4.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.4.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-3.4.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-3.4.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-3.4.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-3.4.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-3.4.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index cd63199613..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/kv-stores/#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-3.4.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-3.4.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-3.4.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.4.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-3.4.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.4.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-3.4.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-3.4.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-3.4.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/from.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/of.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-3.4.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-3.4.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-3.4.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.4.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-3.4.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.4.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.4.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-3.4.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-3.4.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-3.4.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.4.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-3.4.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-3.4.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-3.4.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-3.4.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-3.4.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-3.4.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.4.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.4.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.4.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DOMException/DOMException.mdx b/documentation/versioned_docs/version-3.4.0/globals/DOMException/DOMException.mdx deleted file mode 100644 index 160e40e774..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DOMException/DOMException.mdx +++ /dev/null @@ -1,107 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException() - -The **`DOMException()`** constructor returns a `DOMException` object with a specified message and name. - -## Syntax - -```js -new DOMException() -new DOMException(message) -new DOMException(message, name) -``` - -### Parameters - -- `message` _optional_ - - : A description of the exception. If not present, the empty string `''` is - used. -- `name` _optional_ - - : A string. If the specified name is a [standard error name](#error-names), then getting the [`code`](./code.mdx) property of the `DOMException` object will return the code number corresponding to the specified name. - -### Return value - -A newly created `DOMException` object. - -## Error names - -Common error names are listed here. Some APIs define their own sets of names, so this is not necessarily a complete list. - -Note that the following deprecated historical errors don't have an error name but instead have only a legacy constant code value and a legacy constant name: - -- Legacy code value: `2`, legacy constant name: `DOMSTRING_SIZE_ERR` -- Legacy code value: `6`, legacy constant name: `NO_DATA_ALLOWED_ERR` -- Legacy code value: `16`, legacy constant name: `VALIDATION_ERR` - -> **Note:** Because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past. - -- `IndexSizeError` - - : The index is not in the allowed range. (Legacy code value: `1` and legacy constant name: `INDEX_SIZE_ERR`) -- `HierarchyRequestError` - - : The node tree hierarchy is not correct. (Legacy code value: `3` and legacy constant name: `HIERARCHY_REQUEST_ERR`) -- `WrongDocumentError` - - : The object is in the wrong `Document`. (Legacy code value: `4` and legacy constant name: `WRONG_DOCUMENT_ERR`) -- `InvalidCharacterError` - - : The string contains invalid characters. (Legacy code value: `5` and legacy constant name: `INVALID_CHARACTER_ERR`) -- `NoModificationAllowedError` - - : The object cannot be modified. (Legacy code value: `7` and legacy constant name: `NO_MODIFICATION_ALLOWED_ERR`) -- `NotFoundError` - - : The object cannot be found here. (Legacy code value: `8` and legacy constant name: `NOT_FOUND_ERR`) -- `NotSupportedError` - - : The operation is not supported. (Legacy code value: `9` and legacy constant name: `NOT_SUPPORTED_ERR`) -- `InvalidStateError` - - : The object is in an invalid state. (Legacy code value: `11` and legacy constant name: `INVALID_STATE_ERR`) -- `InUseAttributeError` - - : The attribute is in use. (Legacy code value: `10` and legacy constant name: `INUSE_ATTRIBUTE_ERR`) -- `SyntaxError` - - : The string did not match the expected pattern. (Legacy code value: `12` and legacy constant name: `SYNTAX_ERR`) -- `InvalidModificationError` - - : The object cannot be modified in this way. (Legacy code value: `13` and legacy constant name: `INVALID_MODIFICATION_ERR`) -- `NamespaceError` - - : The operation is not allowed by Namespaces in XML. (Legacy code value: `14` and legacy constant name: `NAMESPACE_ERR`) -- `InvalidAccessError` - - : The object does not support the operation or argument. (Legacy code value: `15` and legacy constant name: `INVALID_ACCESS_ERR`) -- `TypeMismatchError` *deprecated* - - : The type of the object does not match the expected type. (Legacy code value: `17` and legacy constant name: `TYPE_MISMATCH_ERR`) This value is deprecated; the JavaScript `TypeError` exception is now raised instead of a `DOMException` with this value. -- `SecurityError` - - : The operation is insecure. (Legacy code value: `18` and legacy constant name: `SECURITY_ERR`) -- `NetworkError` - - : A network error occurred. (Legacy code value: `19` and legacy constant name: `NETWORK_ERR`) -- `AbortError` - - : The operation was aborted. (Legacy code value: `20` and legacy constant name: `ABORT_ERR`) -- `URLMismatchError` - - : The given URL does not match another URL. (Legacy code value: `21` and legacy constant name: `URL_MISMATCH_ERR`) -- `QuotaExceededError` - - : The quota has been exceeded. (Legacy code value: `22` and legacy constant name: `QUOTA_EXCEEDED_ERR`) -- `TimeoutError` - - : The operation timed out. (Legacy code value: `23` and legacy constant name: `TIMEOUT_ERR`) -- `InvalidNodeTypeError` - - : The node is incorrect or has an incorrect ancestor for this operation. (Legacy code value: `24` and legacy constant name: `INVALID_NODE_TYPE_ERR`) -- `DataCloneError` - - : The object can not be cloned. (Legacy code value: `25` and legacy constant name: `DATA_CLONE_ERR`) -- `EncodingError` - - : The encoding or decoding operation failed (No legacy code value and constant name). -- `NotReadableError` - - : The input/output read operation failed (No legacy code value and constant name). -- `UnknownError` - - : The operation failed for an unknown transient reason (e.g. out of memory) (No legacy code value and constant name). -- `ConstraintError` - - : A mutation operation in a transaction failed because a constraint was not satisfied (No legacy code value and constant name). -- `DataError` - - : Provided data is inadequate (No legacy code value and constant name). -- `TransactionInactiveError` - - : A request was placed against a transaction that is currently not active or is finished (No legacy code value and constant name). -- `ReadOnlyError` - - : The mutating operation was attempted in a "readonly" transaction (No legacy code value and constant name). -- `VersionError` - - : An attempt was made to open a database using a lower version than the existing version (No legacy code value and constant name). -- `OperationError` - - : The operation failed for an operation-specific reason (No legacy code value and constant name). -- `NotAllowedError` - - : The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (No legacy code value and constant name). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/globals/DOMException/code.mdx b/documentation/versioned_docs/version-3.4.0/globals/DOMException/code.mdx deleted file mode 100644 index 21b9836fa4..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DOMException/code.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.code - -The **`code`** read-only property of the `DOMException` interface returns one of the legacy [error code constants](./DOMException.mdx#error-names), or `0` if none match. - -This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the [`name`](./name.mdx) attribute. - -## Value - -One of the [error code constants](./DOMException.mdx#error-names), or `0` if none match. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DOMException/message.mdx b/documentation/versioned_docs/version-3.4.0/globals/DOMException/message.mdx deleted file mode 100644 index 44d3c6b8da..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DOMException/message.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.message - -The **`message`** read-only property of the `DOMException` interface returns a string representing a message or description associated with the given [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DOMException/name.mdx b/documentation/versioned_docs/version-3.4.0/globals/DOMException/name.mdx deleted file mode 100644 index 1dda11b92c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DOMException/name.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.name - -The **`name`** read-only property of the `DOMException` interface returns a string that contains one of the strings associated with an [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/now.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-3.4.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.4.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.4.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-3.4.0/globals/EcKeyImportParams/EcKeyImportParams.mdx b/documentation/versioned_docs/version-3.4.0/globals/EcKeyImportParams/EcKeyImportParams.mdx deleted file mode 100644 index fe6c3a17b7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/EcKeyImportParams/EcKeyImportParams.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EcKeyImportParams - -The **`EcKeyImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when generating any elliptic-curve-based key pair: that is, when the algorithm is identified as ECDSA. - -## Instance properties - -- `name` - - : A string. This should be set to `ECDSA`. -- `namedCurve` - - - : A string representing the name of the elliptic curve to use. This may be any of the following names for [NIST](https://www.nist.gov/)-approved curves: - - - `P-256` - - `P-384` - - `P-521` - diff --git a/documentation/versioned_docs/version-3.4.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-3.4.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-3.4.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-3.4.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-3.4.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-3.4.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-3.4.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.4.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-3.4.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 6cd2c5ec1d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - - `FetchEvent.client.tlsJA3MD5` _**readonly**_ - - : A string representation of the JA3 hash of the TLS ClientHello message. - - `FetchEvent.client.tlsCipherOpensslName` _**readonly**_ - - : A string representation of the cipher suite used to secure the client TLS connection. - - `FetchEvent.client.tlsProtocol` _**readonly**_ - - : A string representation of the TLS protocol version used to secure the client TLS connection. - - `FetchEvent.client.tlsClientCertificate` _**readonly**_ - - : An ArrayBuffer containing the raw client certificate in the mutual TLS handshake message. It is in PEM format. Returns an empty ArrayBuffer if this is not mTLS or available. - - `FetchEvent.client.tlsClientHello` _**readonly**_ - - : An ArrayBuffer containing the raw bytes sent by the client in the TLS ClientHello message. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-3.4.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-3.4.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-3.4.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-3.4.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-3.4.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-3.4.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-3.4.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-3.4.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-3.4.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-3.4.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-3.4.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-3.4.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.4.0/globals/HmacImportParams/HmacImportParams.mdx b/documentation/versioned_docs/version-3.4.0/globals/HmacImportParams/HmacImportParams.mdx deleted file mode 100644 index 816aa2e7dc..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/HmacImportParams/HmacImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# HmacImportParams - -The **`HmacImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey`, when generating a key for the `HMAC` algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `HMAC`. -- `hash` - - - : A string representing the name of the digest function to use. The can take a value of `SHA-1`, `SHA-256`, `SHA-384`, or `SHA-512`. - -- `length` _optional_ - - : A `Number` representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/Infinity.mdx b/documentation/versioned_docs/version-3.4.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-3.4.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-3.4.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-3.4.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.4.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-3.4.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-3.4.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-3.4.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-3.4.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-3.4.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/E.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/log.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/max.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/min.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/random.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/round.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-3.4.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/NaN.mdx b/documentation/versioned_docs/version-3.4.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/create.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/is.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/Object/values.mdx b/documentation/versioned_docs/version-3.4.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-3.4.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-3.4.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-3.4.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-3.4.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-3.4.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-3.4.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-3.4.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-3.4.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-3.4.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-3.4.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-3.4.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-3.4.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-3.4.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-3.4.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-3.4.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-3.4.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-3.4.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-3.4.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-3.4.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-3.4.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.4.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-3.4.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-3.4.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-3.4.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-3.4.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-3.4.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-3.4.0/globals/Request/Request.mdx deleted file mode 100644 index 81af5a46cf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Request/Request.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/clone.mdx b/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/clone.mdx deleted file mode 100644 index e08220c446..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/clone.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.clone() - -The **`clone()`** method of the `Request` interface creates a copy of the current `Request` object. - -Like the underlying `ReadableStream.tee`` api, the `body` of a cloned `Response` -will signal backpressure at the rate of the _faster_ consumer of the two bodies, -and unread data is enqueued internally on the slower consumed `body` -without any limit or backpressure. -Beware when you construct a `Request` from a stream and then `clone` it. - -`clone()` throws a `TypeError` if the request body has already been used. In fact, the main reason `clone()` exists is to allow multiple uses of body objects (when they are one-use only.) - -If you intend to modify the request, you may prefer the `Request` constructor. - -## Syntax - -```js -clone() -``` - -### Parameters - -None. - -### Return value - -A `Request` object, which is an exact copy of the `Request` that `clone()` was called on. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-3.4.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-3.4.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-3.4.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-3.4.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 3477966947..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-3.4.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-3.4.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/String.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.4.0/globals/String/raw.mdx b/documentation/versioned_docs/version-3.4.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index c7cdac8c62..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use [HMAC](#hmac), pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - -### HMAC - -The HMAC algorithm calculates and verifies hash-based message authentication codes according to the -[FIPS 198-1 standard](https://csrc.nist.gov/csrc/media/publications/fips/198/1/final/documents/fips-198-1_final.pdf). - -The digest algorithm to use is specified in the -[`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object -that you pass into [`SubtleCrypto.importKey()`](./importKey.mdx). diff --git a/documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index df9d338369..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use HMAC, pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-3.4.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-3.4.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-3.4.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-3.4.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-3.4.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-3.4.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-3.4.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.4.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-3.4.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-3.4.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.4.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.4.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.4.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-3.4.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-3.4.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.4.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-3.4.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-3.4.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-3.4.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.4.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-3.4.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.4.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-3.4.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-3.4.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-3.4.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-3.4.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-3.4.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-3.4.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-3.4.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-3.4.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.4.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-3.4.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-3.4.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-3.4.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.4.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-3.4.0/globals/atob.mdx b/documentation/versioned_docs/version-3.4.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-3.4.0/globals/btoa.mdx b/documentation/versioned_docs/version-3.4.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-3.4.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-3.4.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-3.4.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/assert.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/clear.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/count.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/count.mdx deleted file mode 100644 index ea8b92a0d4..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` _optional_ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/debug.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/dir.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/error.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/group.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/info.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/log.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/time.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/trace.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/console/warn.mdx b/documentation/versioned_docs/version-3.4.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-3.4.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-3.4.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-3.4.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-3.4.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-3.4.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-3.4.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-3.4.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-3.4.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-3.4.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-3.4.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/escape.mdx b/documentation/versioned_docs/version-3.4.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-3.4.0/globals/eval.mdx b/documentation/versioned_docs/version-3.4.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-3.4.0/globals/fetch.mdx b/documentation/versioned_docs/version-3.4.0/globals/fetch.mdx deleted file mode 100644 index 32581670e4..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/fetch.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/globalThis.mdx b/documentation/versioned_docs/version-3.4.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-3.4.0/globals/isFinite.mdx b/documentation/versioned_docs/version-3.4.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/isNaN.mdx b/documentation/versioned_docs/version-3.4.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-3.4.0/globals/location.mdx b/documentation/versioned_docs/version-3.4.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-3.4.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-3.4.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-3.4.0/globals/parseInt.mdx b/documentation/versioned_docs/version-3.4.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/performance/now.mdx b/documentation/versioned_docs/version-3.4.0/globals/performance/now.mdx deleted file mode 100644 index da8f617cb9..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/performance/now.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.now() - -The **`performance.now()`** method returns a high resolution timestamp in milliseconds. -It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated). - -## Syntax - -```js -now() -``` - -### Parameters - -None. - -### Return value - -Returns a number which represents the time since worker instantation measured in milliseconds. diff --git a/documentation/versioned_docs/version-3.4.0/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-3.4.0/globals/performance/timeOrigin.mdx deleted file mode 100644 index 772a527822..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/performance/timeOrigin.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.timeOrigin - -The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps. - -This value represents the time when the worker was instantiated. - -### Value - -Returns a number which represents the time when the worker was instantation. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.4.0/globals/setInterval.mdx b/documentation/versioned_docs/version-3.4.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-3.4.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-3.4.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-3.4.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-3.4.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-3.4.0/globals/undefined.mdx b/documentation/versioned_docs/version-3.4.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-3.4.0/globals/unescape.mdx b/documentation/versioned_docs/version-3.4.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-3.4.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-3.4.0/index.mdx b/documentation/versioned_docs/version-3.4.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-3.4.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-3.4.0/migration-guide/index.mdx b/documentation/versioned_docs/version-3.4.0/migration-guide/index.mdx deleted file mode 100644 index 543d0432cd..0000000000 --- a/documentation/versioned_docs/version-3.4.0/migration-guide/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# `Migrating from v2 to v3` - -## SimpleCache.delete renamed to SimpleCache.purge and requires purge options to be supplied as the second parameter - -We are renaming because "purge" is already a well-known and documented concept for removing content from Fastly's cache. - -The new addition of a second argument allows the caller to decide what scope to purge the content from, currently they can choose to purge from all of Fastly ("global") or from the POP that contains the currently executing instance ("pop"). We do not provide a default option right now, in the future we may provide a default option, if we discover a common pattern is being used. - -Here is an example of migrating an application using `SimpleCache.delete` to `SimpleCache.purge` with the same purging behaviour: -```diff -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request); - const path = url.pathname; - if (url.searchParams.has('delete')) { -- SimpleCache.delete(path); -+ SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - - -``` - - -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-3.5.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index fffeca92b7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,227 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `dontPool` _: boolean_ _**optional**_ - - Determine whether or not connections to the same backend should be pooled across different sessions. - - Fastly considers two backends “the same” if they're registered with the same name and the exact same settings. - - In those cases, when pooling is enabled, if Session 1 opens a connection to this backend it will be left open, and can be re-used by Session 2. - - This can help improve backend latency, by removing the need for the initial network / TLS handshake(s). - - By default, pooling is enabled for dynamic backends. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-3.5.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-3.5.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index f547ac00d2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, and return a message stating whether the entry was in the Fastly Cache or not. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - return new Response(page ? `${path} is in the cache` : `${path} is not in the cache`, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} -``` diff --git a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index a15a22dc09..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key` if no entry is found (or has expired), the supplied `set` function is executed and it's result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - : A function to execute when the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. - - `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/purge.mdx b/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/purge.mdx deleted file mode 100644 index 44ac6ff92c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCache/purge.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# SimpleCache.purge - -purge the entry associated with the key `key` from the cache. - -## Syntax - -```js -purge(key, options) -``` - -### Parameters - -- `key` _: string_ - - The key to purge from within the cache. - -- `options` _: object_ - - `scope` _: string_ - - : Where to purge the content from. - - Possible values are: - - "global" - This will remove the content from all of Fastly. - - "pop" - This will remove the content from the POP that contains the currently executing instance. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `purge` querystring parameter, we purge the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('purge')) { - SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-3.5.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-3.5.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-3.5.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-3.5.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-3.5.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:env/env.mdx b/documentation/versioned_docs/version-3.5.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.5.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-3.5.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-3.5.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-3.5.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-3.5.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-3.5.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index cd63199613..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/kv-stores/#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-3.5.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-3.5.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-3.5.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.5.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-3.5.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.5.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-3.5.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-3.5.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-3.5.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/from.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/of.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-3.5.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-3.5.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-3.5.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.5.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-3.5.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.5.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.5.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-3.5.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-3.5.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-3.5.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.5.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-3.5.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-3.5.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-3.5.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-3.5.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-3.5.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-3.5.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.5.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.5.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.5.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DOMException/DOMException.mdx b/documentation/versioned_docs/version-3.5.0/globals/DOMException/DOMException.mdx deleted file mode 100644 index 160e40e774..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DOMException/DOMException.mdx +++ /dev/null @@ -1,107 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException() - -The **`DOMException()`** constructor returns a `DOMException` object with a specified message and name. - -## Syntax - -```js -new DOMException() -new DOMException(message) -new DOMException(message, name) -``` - -### Parameters - -- `message` _optional_ - - : A description of the exception. If not present, the empty string `''` is - used. -- `name` _optional_ - - : A string. If the specified name is a [standard error name](#error-names), then getting the [`code`](./code.mdx) property of the `DOMException` object will return the code number corresponding to the specified name. - -### Return value - -A newly created `DOMException` object. - -## Error names - -Common error names are listed here. Some APIs define their own sets of names, so this is not necessarily a complete list. - -Note that the following deprecated historical errors don't have an error name but instead have only a legacy constant code value and a legacy constant name: - -- Legacy code value: `2`, legacy constant name: `DOMSTRING_SIZE_ERR` -- Legacy code value: `6`, legacy constant name: `NO_DATA_ALLOWED_ERR` -- Legacy code value: `16`, legacy constant name: `VALIDATION_ERR` - -> **Note:** Because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past. - -- `IndexSizeError` - - : The index is not in the allowed range. (Legacy code value: `1` and legacy constant name: `INDEX_SIZE_ERR`) -- `HierarchyRequestError` - - : The node tree hierarchy is not correct. (Legacy code value: `3` and legacy constant name: `HIERARCHY_REQUEST_ERR`) -- `WrongDocumentError` - - : The object is in the wrong `Document`. (Legacy code value: `4` and legacy constant name: `WRONG_DOCUMENT_ERR`) -- `InvalidCharacterError` - - : The string contains invalid characters. (Legacy code value: `5` and legacy constant name: `INVALID_CHARACTER_ERR`) -- `NoModificationAllowedError` - - : The object cannot be modified. (Legacy code value: `7` and legacy constant name: `NO_MODIFICATION_ALLOWED_ERR`) -- `NotFoundError` - - : The object cannot be found here. (Legacy code value: `8` and legacy constant name: `NOT_FOUND_ERR`) -- `NotSupportedError` - - : The operation is not supported. (Legacy code value: `9` and legacy constant name: `NOT_SUPPORTED_ERR`) -- `InvalidStateError` - - : The object is in an invalid state. (Legacy code value: `11` and legacy constant name: `INVALID_STATE_ERR`) -- `InUseAttributeError` - - : The attribute is in use. (Legacy code value: `10` and legacy constant name: `INUSE_ATTRIBUTE_ERR`) -- `SyntaxError` - - : The string did not match the expected pattern. (Legacy code value: `12` and legacy constant name: `SYNTAX_ERR`) -- `InvalidModificationError` - - : The object cannot be modified in this way. (Legacy code value: `13` and legacy constant name: `INVALID_MODIFICATION_ERR`) -- `NamespaceError` - - : The operation is not allowed by Namespaces in XML. (Legacy code value: `14` and legacy constant name: `NAMESPACE_ERR`) -- `InvalidAccessError` - - : The object does not support the operation or argument. (Legacy code value: `15` and legacy constant name: `INVALID_ACCESS_ERR`) -- `TypeMismatchError` *deprecated* - - : The type of the object does not match the expected type. (Legacy code value: `17` and legacy constant name: `TYPE_MISMATCH_ERR`) This value is deprecated; the JavaScript `TypeError` exception is now raised instead of a `DOMException` with this value. -- `SecurityError` - - : The operation is insecure. (Legacy code value: `18` and legacy constant name: `SECURITY_ERR`) -- `NetworkError` - - : A network error occurred. (Legacy code value: `19` and legacy constant name: `NETWORK_ERR`) -- `AbortError` - - : The operation was aborted. (Legacy code value: `20` and legacy constant name: `ABORT_ERR`) -- `URLMismatchError` - - : The given URL does not match another URL. (Legacy code value: `21` and legacy constant name: `URL_MISMATCH_ERR`) -- `QuotaExceededError` - - : The quota has been exceeded. (Legacy code value: `22` and legacy constant name: `QUOTA_EXCEEDED_ERR`) -- `TimeoutError` - - : The operation timed out. (Legacy code value: `23` and legacy constant name: `TIMEOUT_ERR`) -- `InvalidNodeTypeError` - - : The node is incorrect or has an incorrect ancestor for this operation. (Legacy code value: `24` and legacy constant name: `INVALID_NODE_TYPE_ERR`) -- `DataCloneError` - - : The object can not be cloned. (Legacy code value: `25` and legacy constant name: `DATA_CLONE_ERR`) -- `EncodingError` - - : The encoding or decoding operation failed (No legacy code value and constant name). -- `NotReadableError` - - : The input/output read operation failed (No legacy code value and constant name). -- `UnknownError` - - : The operation failed for an unknown transient reason (e.g. out of memory) (No legacy code value and constant name). -- `ConstraintError` - - : A mutation operation in a transaction failed because a constraint was not satisfied (No legacy code value and constant name). -- `DataError` - - : Provided data is inadequate (No legacy code value and constant name). -- `TransactionInactiveError` - - : A request was placed against a transaction that is currently not active or is finished (No legacy code value and constant name). -- `ReadOnlyError` - - : The mutating operation was attempted in a "readonly" transaction (No legacy code value and constant name). -- `VersionError` - - : An attempt was made to open a database using a lower version than the existing version (No legacy code value and constant name). -- `OperationError` - - : The operation failed for an operation-specific reason (No legacy code value and constant name). -- `NotAllowedError` - - : The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (No legacy code value and constant name). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/globals/DOMException/code.mdx b/documentation/versioned_docs/version-3.5.0/globals/DOMException/code.mdx deleted file mode 100644 index 21b9836fa4..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DOMException/code.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.code - -The **`code`** read-only property of the `DOMException` interface returns one of the legacy [error code constants](./DOMException.mdx#error-names), or `0` if none match. - -This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the [`name`](./name.mdx) attribute. - -## Value - -One of the [error code constants](./DOMException.mdx#error-names), or `0` if none match. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DOMException/message.mdx b/documentation/versioned_docs/version-3.5.0/globals/DOMException/message.mdx deleted file mode 100644 index 44d3c6b8da..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DOMException/message.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.message - -The **`message`** read-only property of the `DOMException` interface returns a string representing a message or description associated with the given [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DOMException/name.mdx b/documentation/versioned_docs/version-3.5.0/globals/DOMException/name.mdx deleted file mode 100644 index 1dda11b92c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DOMException/name.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.name - -The **`name`** read-only property of the `DOMException` interface returns a string that contains one of the strings associated with an [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/now.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-3.5.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.5.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.5.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-3.5.0/globals/EcKeyImportParams/EcKeyImportParams.mdx b/documentation/versioned_docs/version-3.5.0/globals/EcKeyImportParams/EcKeyImportParams.mdx deleted file mode 100644 index fe6c3a17b7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/EcKeyImportParams/EcKeyImportParams.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EcKeyImportParams - -The **`EcKeyImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when generating any elliptic-curve-based key pair: that is, when the algorithm is identified as ECDSA. - -## Instance properties - -- `name` - - : A string. This should be set to `ECDSA`. -- `namedCurve` - - - : A string representing the name of the elliptic curve to use. This may be any of the following names for [NIST](https://www.nist.gov/)-approved curves: - - - `P-256` - - `P-384` - - `P-521` - diff --git a/documentation/versioned_docs/version-3.5.0/globals/EcdsaParams/EcdsaParams.mdx b/documentation/versioned_docs/version-3.5.0/globals/EcdsaParams/EcdsaParams.mdx deleted file mode 100644 index 5594d480f9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/EcdsaParams/EcdsaParams.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# EcdsaParams - -The **`EcdsaParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.sign()` or `SubtleCrypto.verify()` when using the ECDSA algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `ECDSA`. -- `hash` - - - : A string. An identifier for the digest algorithm to use. This should be one of the following: - - - `SHA-256`: selects the SHA-256 algorithm. - - `SHA-384`: selects the SHA-384 algorithm. - - `SHA-512`: selects the SHA-512 algorithm. - - > **Warning:** `SHA-1` is also supported here but the SHA-1 algorithm is considered vulnerable and should no longer be used. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-3.5.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-3.5.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-3.5.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-3.5.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-3.5.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-3.5.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.5.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-3.5.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 6cd2c5ec1d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - - `FetchEvent.client.tlsJA3MD5` _**readonly**_ - - : A string representation of the JA3 hash of the TLS ClientHello message. - - `FetchEvent.client.tlsCipherOpensslName` _**readonly**_ - - : A string representation of the cipher suite used to secure the client TLS connection. - - `FetchEvent.client.tlsProtocol` _**readonly**_ - - : A string representation of the TLS protocol version used to secure the client TLS connection. - - `FetchEvent.client.tlsClientCertificate` _**readonly**_ - - : An ArrayBuffer containing the raw client certificate in the mutual TLS handshake message. It is in PEM format. Returns an empty ArrayBuffer if this is not mTLS or available. - - `FetchEvent.client.tlsClientHello` _**readonly**_ - - : An ArrayBuffer containing the raw bytes sent by the client in the TLS ClientHello message. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-3.5.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-3.5.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-3.5.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-3.5.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-3.5.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-3.5.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-3.5.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-3.5.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-3.5.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-3.5.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-3.5.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-3.5.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.5.0/globals/HmacImportParams/HmacImportParams.mdx b/documentation/versioned_docs/version-3.5.0/globals/HmacImportParams/HmacImportParams.mdx deleted file mode 100644 index 816aa2e7dc..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/HmacImportParams/HmacImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# HmacImportParams - -The **`HmacImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey`, when generating a key for the `HMAC` algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `HMAC`. -- `hash` - - - : A string representing the name of the digest function to use. The can take a value of `SHA-1`, `SHA-256`, `SHA-384`, or `SHA-512`. - -- `length` _optional_ - - : A `Number` representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/Infinity.mdx b/documentation/versioned_docs/version-3.5.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-3.5.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-3.5.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-3.5.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.5.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-3.5.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-3.5.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-3.5.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-3.5.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-3.5.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/E.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/log.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/max.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/min.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/random.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/round.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-3.5.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/NaN.mdx b/documentation/versioned_docs/version-3.5.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/create.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/is.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/Object/values.mdx b/documentation/versioned_docs/version-3.5.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-3.5.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-3.5.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-3.5.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-3.5.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-3.5.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-3.5.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-3.5.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-3.5.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-3.5.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-3.5.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-3.5.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-3.5.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-3.5.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-3.5.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-3.5.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-3.5.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-3.5.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-3.5.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-3.5.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-3.5.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.5.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-3.5.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-3.5.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-3.5.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-3.5.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-3.5.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-3.5.0/globals/Request/Request.mdx deleted file mode 100644 index 81af5a46cf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Request/Request.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/clone.mdx b/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/clone.mdx deleted file mode 100644 index e08220c446..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/clone.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.clone() - -The **`clone()`** method of the `Request` interface creates a copy of the current `Request` object. - -Like the underlying `ReadableStream.tee`` api, the `body` of a cloned `Response` -will signal backpressure at the rate of the _faster_ consumer of the two bodies, -and unread data is enqueued internally on the slower consumed `body` -without any limit or backpressure. -Beware when you construct a `Request` from a stream and then `clone` it. - -`clone()` throws a `TypeError` if the request body has already been used. In fact, the main reason `clone()` exists is to allow multiple uses of body objects (when they are one-use only.) - -If you intend to modify the request, you may prefer the `Request` constructor. - -## Syntax - -```js -clone() -``` - -### Parameters - -None. - -### Return value - -A `Request` object, which is an exact copy of the `Request` that `clone()` was called on. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-3.5.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-3.5.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-3.5.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-3.5.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 3477966947..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-3.5.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-3.5.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/String.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.5.0/globals/String/raw.mdx b/documentation/versioned_docs/version-3.5.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 7253643753..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,99 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `raw`: [Raw](#raw) format. - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. - - For HMAC: - Pass an [`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object. - - For ECDSA: - Pass an [`EcKeyImportParams`](../../EcKeyImportParams/EcKeyImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - -### Raw - -You can use this format to import or export AES or HMAC secret keys, or Elliptic Curve -public keys. - -In this format the key is supplied as an `ArrayBuffer` containing the raw bytes for the key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index c7cdac8c62..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use [HMAC](#hmac), pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - -### HMAC - -The HMAC algorithm calculates and verifies hash-based message authentication codes according to the -[FIPS 198-1 standard](https://csrc.nist.gov/csrc/media/publications/fips/198/1/final/documents/fips-198-1_final.pdf). - -The digest algorithm to use is specified in the -[`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object -that you pass into [`SubtleCrypto.importKey()`](./importKey.mdx). diff --git a/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index df9d338369..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use HMAC, pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-3.5.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-3.5.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-3.5.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-3.5.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-3.5.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-3.5.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-3.5.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.5.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-3.5.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-3.5.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.5.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.5.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.5.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-3.5.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-3.5.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.5.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-3.5.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-3.5.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-3.5.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.5.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-3.5.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.5.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-3.5.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-3.5.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-3.5.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-3.5.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-3.5.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-3.5.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-3.5.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-3.5.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.5.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-3.5.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-3.5.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-3.5.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.5.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-3.5.0/globals/atob.mdx b/documentation/versioned_docs/version-3.5.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-3.5.0/globals/btoa.mdx b/documentation/versioned_docs/version-3.5.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-3.5.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-3.5.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-3.5.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/assert.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/clear.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/count.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/count.mdx deleted file mode 100644 index ea8b92a0d4..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` _optional_ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/debug.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/dir.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/error.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/group.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/info.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/log.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/time.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/trace.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/console/warn.mdx b/documentation/versioned_docs/version-3.5.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-3.5.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-3.5.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-3.5.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-3.5.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-3.5.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-3.5.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-3.5.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-3.5.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-3.5.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-3.5.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/escape.mdx b/documentation/versioned_docs/version-3.5.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-3.5.0/globals/eval.mdx b/documentation/versioned_docs/version-3.5.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-3.5.0/globals/fetch.mdx b/documentation/versioned_docs/version-3.5.0/globals/fetch.mdx deleted file mode 100644 index 32581670e4..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/fetch.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/globalThis.mdx b/documentation/versioned_docs/version-3.5.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-3.5.0/globals/isFinite.mdx b/documentation/versioned_docs/version-3.5.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/isNaN.mdx b/documentation/versioned_docs/version-3.5.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-3.5.0/globals/location.mdx b/documentation/versioned_docs/version-3.5.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-3.5.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-3.5.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-3.5.0/globals/parseInt.mdx b/documentation/versioned_docs/version-3.5.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/performance/now.mdx b/documentation/versioned_docs/version-3.5.0/globals/performance/now.mdx deleted file mode 100644 index da8f617cb9..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/performance/now.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.now() - -The **`performance.now()`** method returns a high resolution timestamp in milliseconds. -It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated). - -## Syntax - -```js -now() -``` - -### Parameters - -None. - -### Return value - -Returns a number which represents the time since worker instantation measured in milliseconds. diff --git a/documentation/versioned_docs/version-3.5.0/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-3.5.0/globals/performance/timeOrigin.mdx deleted file mode 100644 index 772a527822..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/performance/timeOrigin.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.timeOrigin - -The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps. - -This value represents the time when the worker was instantiated. - -### Value - -Returns a number which represents the time when the worker was instantation. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.5.0/globals/setInterval.mdx b/documentation/versioned_docs/version-3.5.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-3.5.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-3.5.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-3.5.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-3.5.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-3.5.0/globals/undefined.mdx b/documentation/versioned_docs/version-3.5.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-3.5.0/globals/unescape.mdx b/documentation/versioned_docs/version-3.5.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-3.5.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-3.5.0/index.mdx b/documentation/versioned_docs/version-3.5.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-3.5.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-3.5.0/migration-guide/index.mdx b/documentation/versioned_docs/version-3.5.0/migration-guide/index.mdx deleted file mode 100644 index 543d0432cd..0000000000 --- a/documentation/versioned_docs/version-3.5.0/migration-guide/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# `Migrating from v2 to v3` - -## SimpleCache.delete renamed to SimpleCache.purge and requires purge options to be supplied as the second parameter - -We are renaming because "purge" is already a well-known and documented concept for removing content from Fastly's cache. - -The new addition of a second argument allows the caller to decide what scope to purge the content from, currently they can choose to purge from all of Fastly ("global") or from the POP that contains the currently executing instance ("pop"). We do not provide a default option right now, in the future we may provide a default option, if we discover a common pattern is being used. - -Here is an example of migrating an application using `SimpleCache.delete` to `SimpleCache.purge` with the same purging behaviour: -```diff -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request); - const path = url.pathname; - if (url.searchParams.has('delete')) { -- SimpleCache.delete(path); -+ SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - - -``` - - -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-3.6.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index fffeca92b7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,227 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `dontPool` _: boolean_ _**optional**_ - - Determine whether or not connections to the same backend should be pooled across different sessions. - - Fastly considers two backends “the same” if they're registered with the same name and the exact same settings. - - In those cases, when pooling is enabled, if Session 1 opens a connection to this backend it will be left open, and can be re-used by Session 2. - - This can help improve backend latency, by removing the need for the initial network / TLS handshake(s). - - By default, pooling is enabled for dynamic backends. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-3.6.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-3.6.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index f547ac00d2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, and return a message stating whether the entry was in the Fastly Cache or not. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - return new Response(page ? `${path} is in the cache` : `${path} is not in the cache`, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} -``` diff --git a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index a15a22dc09..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key` if no entry is found (or has expired), the supplied `set` function is executed and it's result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - : A function to execute when the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. - - `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/purge.mdx b/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/purge.mdx deleted file mode 100644 index 44ac6ff92c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCache/purge.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# SimpleCache.purge - -purge the entry associated with the key `key` from the cache. - -## Syntax - -```js -purge(key, options) -``` - -### Parameters - -- `key` _: string_ - - The key to purge from within the cache. - -- `options` _: object_ - - `scope` _: string_ - - : Where to purge the content from. - - Possible values are: - - "global" - This will remove the content from all of Fastly. - - "pop" - This will remove the content from the POP that contains the currently executing instance. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `purge` querystring parameter, we purge the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('purge')) { - SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-3.6.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-3.6.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-3.6.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-3.6.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-3.6.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:env/env.mdx b/documentation/versioned_docs/version-3.6.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.6.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-3.6.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-3.6.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-3.6.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-3.6.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-3.6.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-3.6.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-3.6.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-3.6.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.6.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-3.6.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.6.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-3.6.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-3.6.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-3.6.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/from.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/of.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-3.6.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-3.6.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-3.6.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.6.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-3.6.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.6.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.6.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-3.6.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-3.6.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-3.6.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.6.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-3.6.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-3.6.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-3.6.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-3.6.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-3.6.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-3.6.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.6.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.6.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.6.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DOMException/DOMException.mdx b/documentation/versioned_docs/version-3.6.0/globals/DOMException/DOMException.mdx deleted file mode 100644 index 160e40e774..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DOMException/DOMException.mdx +++ /dev/null @@ -1,107 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException() - -The **`DOMException()`** constructor returns a `DOMException` object with a specified message and name. - -## Syntax - -```js -new DOMException() -new DOMException(message) -new DOMException(message, name) -``` - -### Parameters - -- `message` _optional_ - - : A description of the exception. If not present, the empty string `''` is - used. -- `name` _optional_ - - : A string. If the specified name is a [standard error name](#error-names), then getting the [`code`](./code.mdx) property of the `DOMException` object will return the code number corresponding to the specified name. - -### Return value - -A newly created `DOMException` object. - -## Error names - -Common error names are listed here. Some APIs define their own sets of names, so this is not necessarily a complete list. - -Note that the following deprecated historical errors don't have an error name but instead have only a legacy constant code value and a legacy constant name: - -- Legacy code value: `2`, legacy constant name: `DOMSTRING_SIZE_ERR` -- Legacy code value: `6`, legacy constant name: `NO_DATA_ALLOWED_ERR` -- Legacy code value: `16`, legacy constant name: `VALIDATION_ERR` - -> **Note:** Because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past. - -- `IndexSizeError` - - : The index is not in the allowed range. (Legacy code value: `1` and legacy constant name: `INDEX_SIZE_ERR`) -- `HierarchyRequestError` - - : The node tree hierarchy is not correct. (Legacy code value: `3` and legacy constant name: `HIERARCHY_REQUEST_ERR`) -- `WrongDocumentError` - - : The object is in the wrong `Document`. (Legacy code value: `4` and legacy constant name: `WRONG_DOCUMENT_ERR`) -- `InvalidCharacterError` - - : The string contains invalid characters. (Legacy code value: `5` and legacy constant name: `INVALID_CHARACTER_ERR`) -- `NoModificationAllowedError` - - : The object cannot be modified. (Legacy code value: `7` and legacy constant name: `NO_MODIFICATION_ALLOWED_ERR`) -- `NotFoundError` - - : The object cannot be found here. (Legacy code value: `8` and legacy constant name: `NOT_FOUND_ERR`) -- `NotSupportedError` - - : The operation is not supported. (Legacy code value: `9` and legacy constant name: `NOT_SUPPORTED_ERR`) -- `InvalidStateError` - - : The object is in an invalid state. (Legacy code value: `11` and legacy constant name: `INVALID_STATE_ERR`) -- `InUseAttributeError` - - : The attribute is in use. (Legacy code value: `10` and legacy constant name: `INUSE_ATTRIBUTE_ERR`) -- `SyntaxError` - - : The string did not match the expected pattern. (Legacy code value: `12` and legacy constant name: `SYNTAX_ERR`) -- `InvalidModificationError` - - : The object cannot be modified in this way. (Legacy code value: `13` and legacy constant name: `INVALID_MODIFICATION_ERR`) -- `NamespaceError` - - : The operation is not allowed by Namespaces in XML. (Legacy code value: `14` and legacy constant name: `NAMESPACE_ERR`) -- `InvalidAccessError` - - : The object does not support the operation or argument. (Legacy code value: `15` and legacy constant name: `INVALID_ACCESS_ERR`) -- `TypeMismatchError` *deprecated* - - : The type of the object does not match the expected type. (Legacy code value: `17` and legacy constant name: `TYPE_MISMATCH_ERR`) This value is deprecated; the JavaScript `TypeError` exception is now raised instead of a `DOMException` with this value. -- `SecurityError` - - : The operation is insecure. (Legacy code value: `18` and legacy constant name: `SECURITY_ERR`) -- `NetworkError` - - : A network error occurred. (Legacy code value: `19` and legacy constant name: `NETWORK_ERR`) -- `AbortError` - - : The operation was aborted. (Legacy code value: `20` and legacy constant name: `ABORT_ERR`) -- `URLMismatchError` - - : The given URL does not match another URL. (Legacy code value: `21` and legacy constant name: `URL_MISMATCH_ERR`) -- `QuotaExceededError` - - : The quota has been exceeded. (Legacy code value: `22` and legacy constant name: `QUOTA_EXCEEDED_ERR`) -- `TimeoutError` - - : The operation timed out. (Legacy code value: `23` and legacy constant name: `TIMEOUT_ERR`) -- `InvalidNodeTypeError` - - : The node is incorrect or has an incorrect ancestor for this operation. (Legacy code value: `24` and legacy constant name: `INVALID_NODE_TYPE_ERR`) -- `DataCloneError` - - : The object can not be cloned. (Legacy code value: `25` and legacy constant name: `DATA_CLONE_ERR`) -- `EncodingError` - - : The encoding or decoding operation failed (No legacy code value and constant name). -- `NotReadableError` - - : The input/output read operation failed (No legacy code value and constant name). -- `UnknownError` - - : The operation failed for an unknown transient reason (e.g. out of memory) (No legacy code value and constant name). -- `ConstraintError` - - : A mutation operation in a transaction failed because a constraint was not satisfied (No legacy code value and constant name). -- `DataError` - - : Provided data is inadequate (No legacy code value and constant name). -- `TransactionInactiveError` - - : A request was placed against a transaction that is currently not active or is finished (No legacy code value and constant name). -- `ReadOnlyError` - - : The mutating operation was attempted in a "readonly" transaction (No legacy code value and constant name). -- `VersionError` - - : An attempt was made to open a database using a lower version than the existing version (No legacy code value and constant name). -- `OperationError` - - : The operation failed for an operation-specific reason (No legacy code value and constant name). -- `NotAllowedError` - - : The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (No legacy code value and constant name). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/globals/DOMException/code.mdx b/documentation/versioned_docs/version-3.6.0/globals/DOMException/code.mdx deleted file mode 100644 index 21b9836fa4..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DOMException/code.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.code - -The **`code`** read-only property of the `DOMException` interface returns one of the legacy [error code constants](./DOMException.mdx#error-names), or `0` if none match. - -This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the [`name`](./name.mdx) attribute. - -## Value - -One of the [error code constants](./DOMException.mdx#error-names), or `0` if none match. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DOMException/message.mdx b/documentation/versioned_docs/version-3.6.0/globals/DOMException/message.mdx deleted file mode 100644 index 44d3c6b8da..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DOMException/message.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.message - -The **`message`** read-only property of the `DOMException` interface returns a string representing a message or description associated with the given [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DOMException/name.mdx b/documentation/versioned_docs/version-3.6.0/globals/DOMException/name.mdx deleted file mode 100644 index 1dda11b92c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DOMException/name.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.name - -The **`name`** read-only property of the `DOMException` interface returns a string that contains one of the strings associated with an [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/now.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-3.6.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.6.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.6.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-3.6.0/globals/EcKeyImportParams/EcKeyImportParams.mdx b/documentation/versioned_docs/version-3.6.0/globals/EcKeyImportParams/EcKeyImportParams.mdx deleted file mode 100644 index fe6c3a17b7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/EcKeyImportParams/EcKeyImportParams.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EcKeyImportParams - -The **`EcKeyImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when generating any elliptic-curve-based key pair: that is, when the algorithm is identified as ECDSA. - -## Instance properties - -- `name` - - : A string. This should be set to `ECDSA`. -- `namedCurve` - - - : A string representing the name of the elliptic curve to use. This may be any of the following names for [NIST](https://www.nist.gov/)-approved curves: - - - `P-256` - - `P-384` - - `P-521` - diff --git a/documentation/versioned_docs/version-3.6.0/globals/EcdsaParams/EcdsaParams.mdx b/documentation/versioned_docs/version-3.6.0/globals/EcdsaParams/EcdsaParams.mdx deleted file mode 100644 index 5594d480f9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/EcdsaParams/EcdsaParams.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# EcdsaParams - -The **`EcdsaParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.sign()` or `SubtleCrypto.verify()` when using the ECDSA algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `ECDSA`. -- `hash` - - - : A string. An identifier for the digest algorithm to use. This should be one of the following: - - - `SHA-256`: selects the SHA-256 algorithm. - - `SHA-384`: selects the SHA-384 algorithm. - - `SHA-512`: selects the SHA-512 algorithm. - - > **Warning:** `SHA-1` is also supported here but the SHA-1 algorithm is considered vulnerable and should no longer be used. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-3.6.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-3.6.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-3.6.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-3.6.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-3.6.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-3.6.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.6.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-3.6.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 6cd2c5ec1d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - - `FetchEvent.client.tlsJA3MD5` _**readonly**_ - - : A string representation of the JA3 hash of the TLS ClientHello message. - - `FetchEvent.client.tlsCipherOpensslName` _**readonly**_ - - : A string representation of the cipher suite used to secure the client TLS connection. - - `FetchEvent.client.tlsProtocol` _**readonly**_ - - : A string representation of the TLS protocol version used to secure the client TLS connection. - - `FetchEvent.client.tlsClientCertificate` _**readonly**_ - - : An ArrayBuffer containing the raw client certificate in the mutual TLS handshake message. It is in PEM format. Returns an empty ArrayBuffer if this is not mTLS or available. - - `FetchEvent.client.tlsClientHello` _**readonly**_ - - : An ArrayBuffer containing the raw bytes sent by the client in the TLS ClientHello message. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-3.6.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-3.6.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-3.6.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-3.6.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-3.6.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-3.6.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-3.6.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-3.6.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-3.6.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-3.6.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-3.6.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-3.6.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.6.0/globals/HmacImportParams/HmacImportParams.mdx b/documentation/versioned_docs/version-3.6.0/globals/HmacImportParams/HmacImportParams.mdx deleted file mode 100644 index 816aa2e7dc..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/HmacImportParams/HmacImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# HmacImportParams - -The **`HmacImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey`, when generating a key for the `HMAC` algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `HMAC`. -- `hash` - - - : A string representing the name of the digest function to use. The can take a value of `SHA-1`, `SHA-256`, `SHA-384`, or `SHA-512`. - -- `length` _optional_ - - : A `Number` representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/Infinity.mdx b/documentation/versioned_docs/version-3.6.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-3.6.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-3.6.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-3.6.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.6.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-3.6.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-3.6.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-3.6.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-3.6.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-3.6.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/E.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/log.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/max.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/min.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/random.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/round.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-3.6.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/NaN.mdx b/documentation/versioned_docs/version-3.6.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/create.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/is.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/Object/values.mdx b/documentation/versioned_docs/version-3.6.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-3.6.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-3.6.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-3.6.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-3.6.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-3.6.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-3.6.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-3.6.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-3.6.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-3.6.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-3.6.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-3.6.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-3.6.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-3.6.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-3.6.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-3.6.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-3.6.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-3.6.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-3.6.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-3.6.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-3.6.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.6.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-3.6.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-3.6.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-3.6.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-3.6.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-3.6.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-3.6.0/globals/Request/Request.mdx deleted file mode 100644 index 81af5a46cf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Request/Request.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/clone.mdx b/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/clone.mdx deleted file mode 100644 index e08220c446..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/clone.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.clone() - -The **`clone()`** method of the `Request` interface creates a copy of the current `Request` object. - -Like the underlying `ReadableStream.tee`` api, the `body` of a cloned `Response` -will signal backpressure at the rate of the _faster_ consumer of the two bodies, -and unread data is enqueued internally on the slower consumed `body` -without any limit or backpressure. -Beware when you construct a `Request` from a stream and then `clone` it. - -`clone()` throws a `TypeError` if the request body has already been used. In fact, the main reason `clone()` exists is to allow multiple uses of body objects (when they are one-use only.) - -If you intend to modify the request, you may prefer the `Request` constructor. - -## Syntax - -```js -clone() -``` - -### Parameters - -None. - -### Return value - -A `Request` object, which is an exact copy of the `Request` that `clone()` was called on. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-3.6.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-3.6.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-3.6.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-3.6.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 3477966947..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-3.6.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-3.6.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/String.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.6.0/globals/String/raw.mdx b/documentation/versioned_docs/version-3.6.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 7253643753..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,99 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `raw`: [Raw](#raw) format. - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. - - For HMAC: - Pass an [`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object. - - For ECDSA: - Pass an [`EcKeyImportParams`](../../EcKeyImportParams/EcKeyImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - -### Raw - -You can use this format to import or export AES or HMAC secret keys, or Elliptic Curve -public keys. - -In this format the key is supplied as an `ArrayBuffer` containing the raw bytes for the key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index c7cdac8c62..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use [HMAC](#hmac), pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - -### HMAC - -The HMAC algorithm calculates and verifies hash-based message authentication codes according to the -[FIPS 198-1 standard](https://csrc.nist.gov/csrc/media/publications/fips/198/1/final/documents/fips-198-1_final.pdf). - -The digest algorithm to use is specified in the -[`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object -that you pass into [`SubtleCrypto.importKey()`](./importKey.mdx). diff --git a/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index df9d338369..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use HMAC, pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-3.6.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-3.6.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-3.6.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-3.6.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-3.6.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-3.6.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-3.6.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.6.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-3.6.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-3.6.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.6.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.6.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.6.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-3.6.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-3.6.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.6.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-3.6.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-3.6.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-3.6.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.6.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-3.6.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.6.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-3.6.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-3.6.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-3.6.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-3.6.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-3.6.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-3.6.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-3.6.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-3.6.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.6.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-3.6.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-3.6.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-3.6.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.6.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-3.6.0/globals/atob.mdx b/documentation/versioned_docs/version-3.6.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-3.6.0/globals/btoa.mdx b/documentation/versioned_docs/version-3.6.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-3.6.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-3.6.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-3.6.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/assert.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/clear.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/count.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/count.mdx deleted file mode 100644 index ea8b92a0d4..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` _optional_ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/debug.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/dir.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/error.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/group.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/info.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/log.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/time.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/trace.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/console/warn.mdx b/documentation/versioned_docs/version-3.6.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-3.6.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-3.6.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-3.6.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-3.6.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-3.6.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-3.6.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-3.6.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-3.6.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-3.6.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-3.6.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/escape.mdx b/documentation/versioned_docs/version-3.6.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-3.6.0/globals/eval.mdx b/documentation/versioned_docs/version-3.6.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-3.6.0/globals/fetch.mdx b/documentation/versioned_docs/version-3.6.0/globals/fetch.mdx deleted file mode 100644 index 32581670e4..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/fetch.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/globalThis.mdx b/documentation/versioned_docs/version-3.6.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-3.6.0/globals/isFinite.mdx b/documentation/versioned_docs/version-3.6.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/isNaN.mdx b/documentation/versioned_docs/version-3.6.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-3.6.0/globals/location.mdx b/documentation/versioned_docs/version-3.6.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-3.6.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-3.6.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-3.6.0/globals/parseInt.mdx b/documentation/versioned_docs/version-3.6.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/performance/now.mdx b/documentation/versioned_docs/version-3.6.0/globals/performance/now.mdx deleted file mode 100644 index da8f617cb9..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/performance/now.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.now() - -The **`performance.now()`** method returns a high resolution timestamp in milliseconds. -It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated). - -## Syntax - -```js -now() -``` - -### Parameters - -None. - -### Return value - -Returns a number which represents the time since worker instantation measured in milliseconds. diff --git a/documentation/versioned_docs/version-3.6.0/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-3.6.0/globals/performance/timeOrigin.mdx deleted file mode 100644 index 772a527822..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/performance/timeOrigin.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.timeOrigin - -The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps. - -This value represents the time when the worker was instantiated. - -### Value - -Returns a number which represents the time when the worker was instantation. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.6.0/globals/setInterval.mdx b/documentation/versioned_docs/version-3.6.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-3.6.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-3.6.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-3.6.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-3.6.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-3.6.0/globals/undefined.mdx b/documentation/versioned_docs/version-3.6.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-3.6.0/globals/unescape.mdx b/documentation/versioned_docs/version-3.6.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-3.6.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-3.6.0/index.mdx b/documentation/versioned_docs/version-3.6.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-3.6.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-3.6.0/migration-guide/index.mdx b/documentation/versioned_docs/version-3.6.0/migration-guide/index.mdx deleted file mode 100644 index 543d0432cd..0000000000 --- a/documentation/versioned_docs/version-3.6.0/migration-guide/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# `Migrating from v2 to v3` - -## SimpleCache.delete renamed to SimpleCache.purge and requires purge options to be supplied as the second parameter - -We are renaming because "purge" is already a well-known and documented concept for removing content from Fastly's cache. - -The new addition of a second argument allows the caller to decide what scope to purge the content from, currently they can choose to purge from all of Fastly ("global") or from the POP that contains the currently executing instance ("pop"). We do not provide a default option right now, in the future we may provide a default option, if we discover a common pattern is being used. - -Here is an example of migrating an application using `SimpleCache.delete` to `SimpleCache.purge` with the same purging behaviour: -```diff -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request); - const path = url.pathname; - if (url.searchParams.has('delete')) { -- SimpleCache.delete(path); -+ SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - - -``` - - -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-3.7.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index f547ac00d2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, and return a message stating whether the entry was in the Fastly Cache or not. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - return new Response(page ? `${path} is in the cache` : `${path} is not in the cache`, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} -``` diff --git a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index a15a22dc09..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key` if no entry is found (or has expired), the supplied `set` function is executed and it's result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - : A function to execute when the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The number of seconds to store the supplied entry within the cache for. - - `length` _: number_ __optional__ - - The length of value being stored within the cache. This is only used when the `value` is a ReadableStream. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/purge.mdx b/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/purge.mdx deleted file mode 100644 index 44ac6ff92c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCache/purge.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# SimpleCache.purge - -purge the entry associated with the key `key` from the cache. - -## Syntax - -```js -purge(key, options) -``` - -### Parameters - -- `key` _: string_ - - The key to purge from within the cache. - -- `options` _: object_ - - `scope` _: string_ - - : Where to purge the content from. - - Possible values are: - - "global" - This will remove the content from all of Fastly. - - "pop" - This will remove the content from the POP that contains the currently executing instance. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `purge` querystring parameter, we purge the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('purge')) { - SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-3.7.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-3.7.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-3.7.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-3.7.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-3.7.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:env/env.mdx b/documentation/versioned_docs/version-3.7.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.7.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-3.7.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-3.7.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-3.7.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-3.7.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-3.7.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index 6cac3d4b05..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/edge-state/data-stores#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index d84edda3c8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.put('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-3.7.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-3.7.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-3.7.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.7.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-3.7.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.7.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-3.7.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-3.7.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-3.7.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/from.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/of.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-3.7.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-3.7.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-3.7.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.7.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-3.7.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.7.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.7.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-3.7.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-3.7.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-3.7.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.7.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-3.7.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-3.7.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-3.7.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-3.7.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-3.7.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-3.7.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.7.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.7.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.7.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DOMException/DOMException.mdx b/documentation/versioned_docs/version-3.7.0/globals/DOMException/DOMException.mdx deleted file mode 100644 index 160e40e774..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DOMException/DOMException.mdx +++ /dev/null @@ -1,107 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException() - -The **`DOMException()`** constructor returns a `DOMException` object with a specified message and name. - -## Syntax - -```js -new DOMException() -new DOMException(message) -new DOMException(message, name) -``` - -### Parameters - -- `message` _optional_ - - : A description of the exception. If not present, the empty string `''` is - used. -- `name` _optional_ - - : A string. If the specified name is a [standard error name](#error-names), then getting the [`code`](./code.mdx) property of the `DOMException` object will return the code number corresponding to the specified name. - -### Return value - -A newly created `DOMException` object. - -## Error names - -Common error names are listed here. Some APIs define their own sets of names, so this is not necessarily a complete list. - -Note that the following deprecated historical errors don't have an error name but instead have only a legacy constant code value and a legacy constant name: - -- Legacy code value: `2`, legacy constant name: `DOMSTRING_SIZE_ERR` -- Legacy code value: `6`, legacy constant name: `NO_DATA_ALLOWED_ERR` -- Legacy code value: `16`, legacy constant name: `VALIDATION_ERR` - -> **Note:** Because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past. - -- `IndexSizeError` - - : The index is not in the allowed range. (Legacy code value: `1` and legacy constant name: `INDEX_SIZE_ERR`) -- `HierarchyRequestError` - - : The node tree hierarchy is not correct. (Legacy code value: `3` and legacy constant name: `HIERARCHY_REQUEST_ERR`) -- `WrongDocumentError` - - : The object is in the wrong `Document`. (Legacy code value: `4` and legacy constant name: `WRONG_DOCUMENT_ERR`) -- `InvalidCharacterError` - - : The string contains invalid characters. (Legacy code value: `5` and legacy constant name: `INVALID_CHARACTER_ERR`) -- `NoModificationAllowedError` - - : The object cannot be modified. (Legacy code value: `7` and legacy constant name: `NO_MODIFICATION_ALLOWED_ERR`) -- `NotFoundError` - - : The object cannot be found here. (Legacy code value: `8` and legacy constant name: `NOT_FOUND_ERR`) -- `NotSupportedError` - - : The operation is not supported. (Legacy code value: `9` and legacy constant name: `NOT_SUPPORTED_ERR`) -- `InvalidStateError` - - : The object is in an invalid state. (Legacy code value: `11` and legacy constant name: `INVALID_STATE_ERR`) -- `InUseAttributeError` - - : The attribute is in use. (Legacy code value: `10` and legacy constant name: `INUSE_ATTRIBUTE_ERR`) -- `SyntaxError` - - : The string did not match the expected pattern. (Legacy code value: `12` and legacy constant name: `SYNTAX_ERR`) -- `InvalidModificationError` - - : The object cannot be modified in this way. (Legacy code value: `13` and legacy constant name: `INVALID_MODIFICATION_ERR`) -- `NamespaceError` - - : The operation is not allowed by Namespaces in XML. (Legacy code value: `14` and legacy constant name: `NAMESPACE_ERR`) -- `InvalidAccessError` - - : The object does not support the operation or argument. (Legacy code value: `15` and legacy constant name: `INVALID_ACCESS_ERR`) -- `TypeMismatchError` *deprecated* - - : The type of the object does not match the expected type. (Legacy code value: `17` and legacy constant name: `TYPE_MISMATCH_ERR`) This value is deprecated; the JavaScript `TypeError` exception is now raised instead of a `DOMException` with this value. -- `SecurityError` - - : The operation is insecure. (Legacy code value: `18` and legacy constant name: `SECURITY_ERR`) -- `NetworkError` - - : A network error occurred. (Legacy code value: `19` and legacy constant name: `NETWORK_ERR`) -- `AbortError` - - : The operation was aborted. (Legacy code value: `20` and legacy constant name: `ABORT_ERR`) -- `URLMismatchError` - - : The given URL does not match another URL. (Legacy code value: `21` and legacy constant name: `URL_MISMATCH_ERR`) -- `QuotaExceededError` - - : The quota has been exceeded. (Legacy code value: `22` and legacy constant name: `QUOTA_EXCEEDED_ERR`) -- `TimeoutError` - - : The operation timed out. (Legacy code value: `23` and legacy constant name: `TIMEOUT_ERR`) -- `InvalidNodeTypeError` - - : The node is incorrect or has an incorrect ancestor for this operation. (Legacy code value: `24` and legacy constant name: `INVALID_NODE_TYPE_ERR`) -- `DataCloneError` - - : The object can not be cloned. (Legacy code value: `25` and legacy constant name: `DATA_CLONE_ERR`) -- `EncodingError` - - : The encoding or decoding operation failed (No legacy code value and constant name). -- `NotReadableError` - - : The input/output read operation failed (No legacy code value and constant name). -- `UnknownError` - - : The operation failed for an unknown transient reason (e.g. out of memory) (No legacy code value and constant name). -- `ConstraintError` - - : A mutation operation in a transaction failed because a constraint was not satisfied (No legacy code value and constant name). -- `DataError` - - : Provided data is inadequate (No legacy code value and constant name). -- `TransactionInactiveError` - - : A request was placed against a transaction that is currently not active or is finished (No legacy code value and constant name). -- `ReadOnlyError` - - : The mutating operation was attempted in a "readonly" transaction (No legacy code value and constant name). -- `VersionError` - - : An attempt was made to open a database using a lower version than the existing version (No legacy code value and constant name). -- `OperationError` - - : The operation failed for an operation-specific reason (No legacy code value and constant name). -- `NotAllowedError` - - : The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (No legacy code value and constant name). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/globals/DOMException/code.mdx b/documentation/versioned_docs/version-3.7.0/globals/DOMException/code.mdx deleted file mode 100644 index 21b9836fa4..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DOMException/code.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.code - -The **`code`** read-only property of the `DOMException` interface returns one of the legacy [error code constants](./DOMException.mdx#error-names), or `0` if none match. - -This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the [`name`](./name.mdx) attribute. - -## Value - -One of the [error code constants](./DOMException.mdx#error-names), or `0` if none match. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DOMException/message.mdx b/documentation/versioned_docs/version-3.7.0/globals/DOMException/message.mdx deleted file mode 100644 index 44d3c6b8da..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DOMException/message.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.message - -The **`message`** read-only property of the `DOMException` interface returns a string representing a message or description associated with the given [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DOMException/name.mdx b/documentation/versioned_docs/version-3.7.0/globals/DOMException/name.mdx deleted file mode 100644 index 1dda11b92c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DOMException/name.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.name - -The **`name`** read-only property of the `DOMException` interface returns a string that contains one of the strings associated with an [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/now.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-3.7.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.7.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.7.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-3.7.0/globals/EcdsaParams/EcdsaParams.mdx b/documentation/versioned_docs/version-3.7.0/globals/EcdsaParams/EcdsaParams.mdx deleted file mode 100644 index 5594d480f9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/EcdsaParams/EcdsaParams.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# EcdsaParams - -The **`EcdsaParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.sign()` or `SubtleCrypto.verify()` when using the ECDSA algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `ECDSA`. -- `hash` - - - : A string. An identifier for the digest algorithm to use. This should be one of the following: - - - `SHA-256`: selects the SHA-256 algorithm. - - `SHA-384`: selects the SHA-384 algorithm. - - `SHA-512`: selects the SHA-512 algorithm. - - > **Warning:** `SHA-1` is also supported here but the SHA-1 algorithm is considered vulnerable and should no longer be used. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-3.7.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-3.7.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-3.7.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-3.7.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-3.7.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-3.7.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.7.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-3.7.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 6cd2c5ec1d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - - `FetchEvent.client.tlsJA3MD5` _**readonly**_ - - : A string representation of the JA3 hash of the TLS ClientHello message. - - `FetchEvent.client.tlsCipherOpensslName` _**readonly**_ - - : A string representation of the cipher suite used to secure the client TLS connection. - - `FetchEvent.client.tlsProtocol` _**readonly**_ - - : A string representation of the TLS protocol version used to secure the client TLS connection. - - `FetchEvent.client.tlsClientCertificate` _**readonly**_ - - : An ArrayBuffer containing the raw client certificate in the mutual TLS handshake message. It is in PEM format. Returns an empty ArrayBuffer if this is not mTLS or available. - - `FetchEvent.client.tlsClientHello` _**readonly**_ - - : An ArrayBuffer containing the raw bytes sent by the client in the TLS ClientHello message. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-3.7.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-3.7.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-3.7.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-3.7.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-3.7.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-3.7.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-3.7.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-3.7.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-3.7.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-3.7.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-3.7.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-3.7.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.7.0/globals/HmacImportParams/HmacImportParams.mdx b/documentation/versioned_docs/version-3.7.0/globals/HmacImportParams/HmacImportParams.mdx deleted file mode 100644 index 816aa2e7dc..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/HmacImportParams/HmacImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# HmacImportParams - -The **`HmacImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey`, when generating a key for the `HMAC` algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `HMAC`. -- `hash` - - - : A string representing the name of the digest function to use. The can take a value of `SHA-1`, `SHA-256`, `SHA-384`, or `SHA-512`. - -- `length` _optional_ - - : A `Number` representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/Infinity.mdx b/documentation/versioned_docs/version-3.7.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-3.7.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-3.7.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-3.7.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.7.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-3.7.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-3.7.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-3.7.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-3.7.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-3.7.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/E.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/log.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/max.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/min.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/random.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/round.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-3.7.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/NaN.mdx b/documentation/versioned_docs/version-3.7.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/create.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/is.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/Object/values.mdx b/documentation/versioned_docs/version-3.7.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-3.7.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-3.7.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-3.7.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-3.7.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-3.7.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-3.7.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-3.7.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-3.7.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-3.7.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-3.7.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-3.7.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-3.7.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-3.7.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-3.7.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-3.7.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-3.7.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-3.7.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-3.7.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-3.7.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-3.7.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.7.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-3.7.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-3.7.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-3.7.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-3.7.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-3.7.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-3.7.0/globals/Request/Request.mdx deleted file mode 100644 index 81af5a46cf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Request/Request.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/clone.mdx b/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/clone.mdx deleted file mode 100644 index e08220c446..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/clone.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.clone() - -The **`clone()`** method of the `Request` interface creates a copy of the current `Request` object. - -Like the underlying `ReadableStream.tee`` api, the `body` of a cloned `Response` -will signal backpressure at the rate of the _faster_ consumer of the two bodies, -and unread data is enqueued internally on the slower consumed `body` -without any limit or backpressure. -Beware when you construct a `Request` from a stream and then `clone` it. - -`clone()` throws a `TypeError` if the request body has already been used. In fact, the main reason `clone()` exists is to allow multiple uses of body objects (when they are one-use only.) - -If you intend to modify the request, you may prefer the `Request` constructor. - -## Syntax - -```js -clone() -``` - -### Parameters - -None. - -### Return value - -A `Request` object, which is an exact copy of the `Request` that `clone()` was called on. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-3.7.0/globals/Response/Response.mdx deleted file mode 100644 index 334bd5ca6c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Response/Response.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-3.7.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-3.7.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-3.7.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 3477966947..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-3.7.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-3.7.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/String.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.7.0/globals/String/raw.mdx b/documentation/versioned_docs/version-3.7.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 7253643753..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,99 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `raw`: [Raw](#raw) format. - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. - - For HMAC: - Pass an [`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object. - - For ECDSA: - Pass an [`EcKeyImportParams`](../../EcKeyImportParams/EcKeyImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - -### Raw - -You can use this format to import or export AES or HMAC secret keys, or Elliptic Curve -public keys. - -In this format the key is supplied as an `ArrayBuffer` containing the raw bytes for the key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index c7cdac8c62..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use [HMAC](#hmac), pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - -### HMAC - -The HMAC algorithm calculates and verifies hash-based message authentication codes according to the -[FIPS 198-1 standard](https://csrc.nist.gov/csrc/media/publications/fips/198/1/final/documents/fips-198-1_final.pdf). - -The digest algorithm to use is specified in the -[`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object -that you pass into [`SubtleCrypto.importKey()`](./importKey.mdx). diff --git a/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index df9d338369..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use HMAC, pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-3.7.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-3.7.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-3.7.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-3.7.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-3.7.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-3.7.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-3.7.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.7.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-3.7.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-3.7.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.7.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.7.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.7.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-3.7.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-3.7.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.7.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-3.7.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-3.7.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-3.7.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.7.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-3.7.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.7.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-3.7.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-3.7.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-3.7.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-3.7.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-3.7.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-3.7.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-3.7.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-3.7.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.7.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-3.7.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-3.7.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-3.7.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.7.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-3.7.0/globals/atob.mdx b/documentation/versioned_docs/version-3.7.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-3.7.0/globals/btoa.mdx b/documentation/versioned_docs/version-3.7.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-3.7.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-3.7.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-3.7.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/assert.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/clear.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/count.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/count.mdx deleted file mode 100644 index ea8b92a0d4..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` _optional_ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/debug.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/dir.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/error.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/group.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/info.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/log.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/time.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/trace.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/console/warn.mdx b/documentation/versioned_docs/version-3.7.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-3.7.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-3.7.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-3.7.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-3.7.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-3.7.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-3.7.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-3.7.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-3.7.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-3.7.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-3.7.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/escape.mdx b/documentation/versioned_docs/version-3.7.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-3.7.0/globals/eval.mdx b/documentation/versioned_docs/version-3.7.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-3.7.0/globals/fetch.mdx b/documentation/versioned_docs/version-3.7.0/globals/fetch.mdx deleted file mode 100644 index 32581670e4..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/fetch.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/globalThis.mdx b/documentation/versioned_docs/version-3.7.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-3.7.0/globals/isFinite.mdx b/documentation/versioned_docs/version-3.7.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/isNaN.mdx b/documentation/versioned_docs/version-3.7.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-3.7.0/globals/location.mdx b/documentation/versioned_docs/version-3.7.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-3.7.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-3.7.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-3.7.0/globals/parseInt.mdx b/documentation/versioned_docs/version-3.7.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/performance/now.mdx b/documentation/versioned_docs/version-3.7.0/globals/performance/now.mdx deleted file mode 100644 index da8f617cb9..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/performance/now.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.now() - -The **`performance.now()`** method returns a high resolution timestamp in milliseconds. -It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated). - -## Syntax - -```js -now() -``` - -### Parameters - -None. - -### Return value - -Returns a number which represents the time since worker instantation measured in milliseconds. diff --git a/documentation/versioned_docs/version-3.7.0/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-3.7.0/globals/performance/timeOrigin.mdx deleted file mode 100644 index 772a527822..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/performance/timeOrigin.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.timeOrigin - -The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps. - -This value represents the time when the worker was instantiated. - -### Value - -Returns a number which represents the time when the worker was instantation. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.7.0/globals/setInterval.mdx b/documentation/versioned_docs/version-3.7.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-3.7.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-3.7.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-3.7.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-3.7.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-3.7.0/globals/undefined.mdx b/documentation/versioned_docs/version-3.7.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-3.7.0/globals/unescape.mdx b/documentation/versioned_docs/version-3.7.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-3.7.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-3.7.0/index.mdx b/documentation/versioned_docs/version-3.7.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-3.7.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-3.7.0/migration-guide/index.mdx b/documentation/versioned_docs/version-3.7.0/migration-guide/index.mdx deleted file mode 100644 index 543d0432cd..0000000000 --- a/documentation/versioned_docs/version-3.7.0/migration-guide/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# `Migrating from v2 to v3` - -## SimpleCache.delete renamed to SimpleCache.purge and requires purge options to be supplied as the second parameter - -We are renaming because "purge" is already a well-known and documented concept for removing content from Fastly's cache. - -The new addition of a second argument allows the caller to decide what scope to purge the content from, currently they can choose to purge from all of Fastly ("global") or from the POP that contains the currently executing instance ("pop"). We do not provide a default option right now, in the future we may provide a default option, if we discover a common pattern is being used. - -Here is an example of migrating an application using `SimpleCache.delete` to `SimpleCache.purge` with the same purging behaviour: -```diff -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request); - const path = url.pathname; - if (url.searchParams.has('delete')) { -- SimpleCache.delete(path); -+ SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - - -``` - - -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index ec9c755f38..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,227 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Backend constructors can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `dontPool` _: boolean_ _**optional**_ - - Determine whether or not connections to the same backend should be pooled across different sessions. - - Fastly considers two backends “the same” if they're registered with the same name and the exact same settings. - - In those cases, when pooling is enabled, if Session 1 opens a connection to this backend it will be left open, and can be re-used by Session 2. - - This can help improve backend latency, by removing the need for the initial network / TLS handshake(s). - - By default, pooling is enabled for dynamic backends. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - diff --git a/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/exists.mdx b/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/exists.mdx deleted file mode 100644 index d4d75b304f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/exists.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.exists() - -The **`Backend.exists()`** method returns a boolean indicating if a Backend with the given name exists or not. - -## Syntax - -```js -exists(name) -``` - -### Return value - -A boolean indicating if a Backend with the given name exists or not. diff --git a/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/fromName.mdx b/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/fromName.mdx deleted file mode 100644 index 471b6699dc..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/fromName.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.fromName() - -Returns the `Backend` instance with the given name, if one exists. If one does not exist, an error is thrown. - -## Syntax - -```js -fromName(name) -``` - -### Return value - -A `Backend` instance. diff --git a/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/health.mdx b/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/health.mdx deleted file mode 100644 index e4b39c9012..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/health.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.health() - -The **`Backend.health()`** method returns a string representing the health of the given Backend instance. - -## Syntax - -```js -Backend.health(backend) -``` - -### Return value - -A string representing the health of the specified Backend value. - -Possible values are: -- `"healthy"` - The backend's health check has succeeded, indicating the backend is working as expected and should receive requests. -- `"unhealthy"` - The backend's health check has failed, indicating the backend is not working as expected and should not receive requests. -- `"unknown"` - The backend does not have a health check configured. diff --git a/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/prototype/toName.mdx b/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/prototype/toName.mdx deleted file mode 100644 index f7667882de..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/prototype/toName.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.prototype.toName() - -The **`toName()`** method returns the name associated with the `Backend` instance. - -## Syntax - -```js -toName() -``` - -### Return value - -A string which contains the name of the Backend. diff --git a/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-3.8.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index f547ac00d2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, and return a message stating whether the entry was in the Fastly Cache or not. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - return new Response(page ? `${path} is in the cache` : `${path} is not in the cache`, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} -``` diff --git a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/purge.mdx b/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/purge.mdx deleted file mode 100644 index 44ac6ff92c..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCache/purge.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# SimpleCache.purge - -purge the entry associated with the key `key` from the cache. - -## Syntax - -```js -purge(key, options) -``` - -### Parameters - -- `key` _: string_ - - The key to purge from within the cache. - -- `options` _: object_ - - `scope` _: string_ - - : Where to purge the content from. - - Possible values are: - - "global" - This will remove the content from all of Fastly. - - "pop" - This will remove the content from the POP that contains the currently executing instance. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `purge` querystring parameter, we purge the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('purge')) { - SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-3.8.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-3.8.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-3.8.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-3.8.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-3.8.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:env/env.mdx b/documentation/versioned_docs/version-3.8.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.8.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-3.8.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-3.8.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-3.8.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-3.8.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-3.8.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index 6cac3d4b05..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/edge-state/data-stores#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-3.8.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-3.8.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-3.8.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.8.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-3.8.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.8.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-3.8.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-3.8.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-3.8.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/from.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/of.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-3.8.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-3.8.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-3.8.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.8.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-3.8.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.8.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.8.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-3.8.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-3.8.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-3.8.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.8.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-3.8.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-3.8.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-3.8.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-3.8.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-3.8.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-3.8.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.8.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.8.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.8.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DOMException/DOMException.mdx b/documentation/versioned_docs/version-3.8.0/globals/DOMException/DOMException.mdx deleted file mode 100644 index 160e40e774..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DOMException/DOMException.mdx +++ /dev/null @@ -1,107 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException() - -The **`DOMException()`** constructor returns a `DOMException` object with a specified message and name. - -## Syntax - -```js -new DOMException() -new DOMException(message) -new DOMException(message, name) -``` - -### Parameters - -- `message` _optional_ - - : A description of the exception. If not present, the empty string `''` is - used. -- `name` _optional_ - - : A string. If the specified name is a [standard error name](#error-names), then getting the [`code`](./code.mdx) property of the `DOMException` object will return the code number corresponding to the specified name. - -### Return value - -A newly created `DOMException` object. - -## Error names - -Common error names are listed here. Some APIs define their own sets of names, so this is not necessarily a complete list. - -Note that the following deprecated historical errors don't have an error name but instead have only a legacy constant code value and a legacy constant name: - -- Legacy code value: `2`, legacy constant name: `DOMSTRING_SIZE_ERR` -- Legacy code value: `6`, legacy constant name: `NO_DATA_ALLOWED_ERR` -- Legacy code value: `16`, legacy constant name: `VALIDATION_ERR` - -> **Note:** Because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past. - -- `IndexSizeError` - - : The index is not in the allowed range. (Legacy code value: `1` and legacy constant name: `INDEX_SIZE_ERR`) -- `HierarchyRequestError` - - : The node tree hierarchy is not correct. (Legacy code value: `3` and legacy constant name: `HIERARCHY_REQUEST_ERR`) -- `WrongDocumentError` - - : The object is in the wrong `Document`. (Legacy code value: `4` and legacy constant name: `WRONG_DOCUMENT_ERR`) -- `InvalidCharacterError` - - : The string contains invalid characters. (Legacy code value: `5` and legacy constant name: `INVALID_CHARACTER_ERR`) -- `NoModificationAllowedError` - - : The object cannot be modified. (Legacy code value: `7` and legacy constant name: `NO_MODIFICATION_ALLOWED_ERR`) -- `NotFoundError` - - : The object cannot be found here. (Legacy code value: `8` and legacy constant name: `NOT_FOUND_ERR`) -- `NotSupportedError` - - : The operation is not supported. (Legacy code value: `9` and legacy constant name: `NOT_SUPPORTED_ERR`) -- `InvalidStateError` - - : The object is in an invalid state. (Legacy code value: `11` and legacy constant name: `INVALID_STATE_ERR`) -- `InUseAttributeError` - - : The attribute is in use. (Legacy code value: `10` and legacy constant name: `INUSE_ATTRIBUTE_ERR`) -- `SyntaxError` - - : The string did not match the expected pattern. (Legacy code value: `12` and legacy constant name: `SYNTAX_ERR`) -- `InvalidModificationError` - - : The object cannot be modified in this way. (Legacy code value: `13` and legacy constant name: `INVALID_MODIFICATION_ERR`) -- `NamespaceError` - - : The operation is not allowed by Namespaces in XML. (Legacy code value: `14` and legacy constant name: `NAMESPACE_ERR`) -- `InvalidAccessError` - - : The object does not support the operation or argument. (Legacy code value: `15` and legacy constant name: `INVALID_ACCESS_ERR`) -- `TypeMismatchError` *deprecated* - - : The type of the object does not match the expected type. (Legacy code value: `17` and legacy constant name: `TYPE_MISMATCH_ERR`) This value is deprecated; the JavaScript `TypeError` exception is now raised instead of a `DOMException` with this value. -- `SecurityError` - - : The operation is insecure. (Legacy code value: `18` and legacy constant name: `SECURITY_ERR`) -- `NetworkError` - - : A network error occurred. (Legacy code value: `19` and legacy constant name: `NETWORK_ERR`) -- `AbortError` - - : The operation was aborted. (Legacy code value: `20` and legacy constant name: `ABORT_ERR`) -- `URLMismatchError` - - : The given URL does not match another URL. (Legacy code value: `21` and legacy constant name: `URL_MISMATCH_ERR`) -- `QuotaExceededError` - - : The quota has been exceeded. (Legacy code value: `22` and legacy constant name: `QUOTA_EXCEEDED_ERR`) -- `TimeoutError` - - : The operation timed out. (Legacy code value: `23` and legacy constant name: `TIMEOUT_ERR`) -- `InvalidNodeTypeError` - - : The node is incorrect or has an incorrect ancestor for this operation. (Legacy code value: `24` and legacy constant name: `INVALID_NODE_TYPE_ERR`) -- `DataCloneError` - - : The object can not be cloned. (Legacy code value: `25` and legacy constant name: `DATA_CLONE_ERR`) -- `EncodingError` - - : The encoding or decoding operation failed (No legacy code value and constant name). -- `NotReadableError` - - : The input/output read operation failed (No legacy code value and constant name). -- `UnknownError` - - : The operation failed for an unknown transient reason (e.g. out of memory) (No legacy code value and constant name). -- `ConstraintError` - - : A mutation operation in a transaction failed because a constraint was not satisfied (No legacy code value and constant name). -- `DataError` - - : Provided data is inadequate (No legacy code value and constant name). -- `TransactionInactiveError` - - : A request was placed against a transaction that is currently not active or is finished (No legacy code value and constant name). -- `ReadOnlyError` - - : The mutating operation was attempted in a "readonly" transaction (No legacy code value and constant name). -- `VersionError` - - : An attempt was made to open a database using a lower version than the existing version (No legacy code value and constant name). -- `OperationError` - - : The operation failed for an operation-specific reason (No legacy code value and constant name). -- `NotAllowedError` - - : The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (No legacy code value and constant name). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/globals/DOMException/code.mdx b/documentation/versioned_docs/version-3.8.0/globals/DOMException/code.mdx deleted file mode 100644 index 21b9836fa4..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DOMException/code.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.code - -The **`code`** read-only property of the `DOMException` interface returns one of the legacy [error code constants](./DOMException.mdx#error-names), or `0` if none match. - -This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the [`name`](./name.mdx) attribute. - -## Value - -One of the [error code constants](./DOMException.mdx#error-names), or `0` if none match. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DOMException/message.mdx b/documentation/versioned_docs/version-3.8.0/globals/DOMException/message.mdx deleted file mode 100644 index 44d3c6b8da..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DOMException/message.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.message - -The **`message`** read-only property of the `DOMException` interface returns a string representing a message or description associated with the given [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DOMException/name.mdx b/documentation/versioned_docs/version-3.8.0/globals/DOMException/name.mdx deleted file mode 100644 index 1dda11b92c..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DOMException/name.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.name - -The **`name`** read-only property of the `DOMException` interface returns a string that contains one of the strings associated with an [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/now.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-3.8.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.8.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.8.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-3.8.0/globals/EcKeyImportParams/EcKeyImportParams.mdx b/documentation/versioned_docs/version-3.8.0/globals/EcKeyImportParams/EcKeyImportParams.mdx deleted file mode 100644 index ba566b82d2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/EcKeyImportParams/EcKeyImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EcKeyImportParams - -The **`EcKeyImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when generating any elliptic-curve-based key pair: that is, when the algorithm is identified as ECDSA. - -## Instance properties - -- `name` - - : A string. This should be set to `ECDSA`. -- `namedCurve` - - - : A string representing the name of the elliptic curve to use. This may be any of the following names for [NIST](https://www.nist.gov/)-approved curves: - - - `P-256` - - `P-384` - - `P-521` diff --git a/documentation/versioned_docs/version-3.8.0/globals/EcdsaParams/EcdsaParams.mdx b/documentation/versioned_docs/version-3.8.0/globals/EcdsaParams/EcdsaParams.mdx deleted file mode 100644 index 5594d480f9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/EcdsaParams/EcdsaParams.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# EcdsaParams - -The **`EcdsaParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.sign()` or `SubtleCrypto.verify()` when using the ECDSA algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `ECDSA`. -- `hash` - - - : A string. An identifier for the digest algorithm to use. This should be one of the following: - - - `SHA-256`: selects the SHA-256 algorithm. - - `SHA-384`: selects the SHA-384 algorithm. - - `SHA-512`: selects the SHA-512 algorithm. - - > **Warning:** `SHA-1` is also supported here but the SHA-1 algorithm is considered vulnerable and should no longer be used. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-3.8.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-3.8.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-3.8.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-3.8.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-3.8.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-3.8.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.8.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-3.8.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 6cd2c5ec1d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - - `FetchEvent.client.tlsJA3MD5` _**readonly**_ - - : A string representation of the JA3 hash of the TLS ClientHello message. - - `FetchEvent.client.tlsCipherOpensslName` _**readonly**_ - - : A string representation of the cipher suite used to secure the client TLS connection. - - `FetchEvent.client.tlsProtocol` _**readonly**_ - - : A string representation of the TLS protocol version used to secure the client TLS connection. - - `FetchEvent.client.tlsClientCertificate` _**readonly**_ - - : An ArrayBuffer containing the raw client certificate in the mutual TLS handshake message. It is in PEM format. Returns an empty ArrayBuffer if this is not mTLS or available. - - `FetchEvent.client.tlsClientHello` _**readonly**_ - - : An ArrayBuffer containing the raw bytes sent by the client in the TLS ClientHello message. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-3.8.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-3.8.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-3.8.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-3.8.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-3.8.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-3.8.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-3.8.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-3.8.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-3.8.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-3.8.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-3.8.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-3.8.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.8.0/globals/HmacImportParams/HmacImportParams.mdx b/documentation/versioned_docs/version-3.8.0/globals/HmacImportParams/HmacImportParams.mdx deleted file mode 100644 index 816aa2e7dc..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/HmacImportParams/HmacImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# HmacImportParams - -The **`HmacImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey`, when generating a key for the `HMAC` algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `HMAC`. -- `hash` - - - : A string representing the name of the digest function to use. The can take a value of `SHA-1`, `SHA-256`, `SHA-384`, or `SHA-512`. - -- `length` _optional_ - - : A `Number` representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/Infinity.mdx b/documentation/versioned_docs/version-3.8.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-3.8.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-3.8.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-3.8.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.8.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-3.8.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-3.8.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-3.8.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-3.8.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-3.8.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/E.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/log.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/max.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/min.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/random.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/round.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-3.8.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/NaN.mdx b/documentation/versioned_docs/version-3.8.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/create.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/is.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/Object/values.mdx b/documentation/versioned_docs/version-3.8.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-3.8.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-3.8.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-3.8.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-3.8.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-3.8.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-3.8.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-3.8.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-3.8.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-3.8.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-3.8.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-3.8.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-3.8.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-3.8.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-3.8.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-3.8.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-3.8.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-3.8.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-3.8.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-3.8.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-3.8.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.8.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-3.8.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-3.8.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-3.8.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-3.8.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-3.8.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/clone.mdx b/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/clone.mdx deleted file mode 100644 index e08220c446..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/clone.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.clone() - -The **`clone()`** method of the `Request` interface creates a copy of the current `Request` object. - -Like the underlying `ReadableStream.tee`` api, the `body` of a cloned `Response` -will signal backpressure at the rate of the _faster_ consumer of the two bodies, -and unread data is enqueued internally on the slower consumed `body` -without any limit or backpressure. -Beware when you construct a `Request` from a stream and then `clone` it. - -`clone()` throws a `TypeError` if the request body has already been used. In fact, the main reason `clone()` exists is to allow multiple uses of body objects (when they are one-use only.) - -If you intend to modify the request, you may prefer the `Request` constructor. - -## Syntax - -```js -clone() -``` - -### Parameters - -None. - -### Return value - -A `Request` object, which is an exact copy of the `Request` that `clone()` was called on. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-3.8.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-3.8.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-3.8.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 3477966947..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-3.8.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-3.8.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/String.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.8.0/globals/String/raw.mdx b/documentation/versioned_docs/version-3.8.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 7253643753..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,99 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `raw`: [Raw](#raw) format. - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. - - For HMAC: - Pass an [`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object. - - For ECDSA: - Pass an [`EcKeyImportParams`](../../EcKeyImportParams/EcKeyImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - -### Raw - -You can use this format to import or export AES or HMAC secret keys, or Elliptic Curve -public keys. - -In this format the key is supplied as an `ArrayBuffer` containing the raw bytes for the key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index c7cdac8c62..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use [HMAC](#hmac), pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - -### HMAC - -The HMAC algorithm calculates and verifies hash-based message authentication codes according to the -[FIPS 198-1 standard](https://csrc.nist.gov/csrc/media/publications/fips/198/1/final/documents/fips-198-1_final.pdf). - -The digest algorithm to use is specified in the -[`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object -that you pass into [`SubtleCrypto.importKey()`](./importKey.mdx). diff --git a/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index df9d338369..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use HMAC, pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-3.8.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-3.8.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-3.8.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-3.8.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-3.8.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-3.8.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-3.8.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.8.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-3.8.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-3.8.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.8.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.8.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.8.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-3.8.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-3.8.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.8.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-3.8.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-3.8.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-3.8.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.8.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-3.8.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.8.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-3.8.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-3.8.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-3.8.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-3.8.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-3.8.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-3.8.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-3.8.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-3.8.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.8.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-3.8.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-3.8.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-3.8.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.8.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-3.8.0/globals/atob.mdx b/documentation/versioned_docs/version-3.8.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-3.8.0/globals/btoa.mdx b/documentation/versioned_docs/version-3.8.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-3.8.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-3.8.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-3.8.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/assert.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/clear.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/count.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/count.mdx deleted file mode 100644 index ea8b92a0d4..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` _optional_ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/debug.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/dir.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/error.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/group.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/info.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/log.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/time.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/trace.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/console/warn.mdx b/documentation/versioned_docs/version-3.8.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-3.8.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-3.8.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-3.8.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-3.8.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-3.8.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-3.8.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-3.8.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-3.8.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-3.8.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-3.8.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/escape.mdx b/documentation/versioned_docs/version-3.8.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-3.8.0/globals/eval.mdx b/documentation/versioned_docs/version-3.8.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-3.8.0/globals/fetch.mdx b/documentation/versioned_docs/version-3.8.0/globals/fetch.mdx deleted file mode 100644 index 32581670e4..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/fetch.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/globalThis.mdx b/documentation/versioned_docs/version-3.8.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-3.8.0/globals/isFinite.mdx b/documentation/versioned_docs/version-3.8.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/isNaN.mdx b/documentation/versioned_docs/version-3.8.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-3.8.0/globals/location.mdx b/documentation/versioned_docs/version-3.8.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-3.8.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-3.8.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-3.8.0/globals/parseInt.mdx b/documentation/versioned_docs/version-3.8.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/performance/now.mdx b/documentation/versioned_docs/version-3.8.0/globals/performance/now.mdx deleted file mode 100644 index da8f617cb9..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/performance/now.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.now() - -The **`performance.now()`** method returns a high resolution timestamp in milliseconds. -It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated). - -## Syntax - -```js -now() -``` - -### Parameters - -None. - -### Return value - -Returns a number which represents the time since worker instantation measured in milliseconds. diff --git a/documentation/versioned_docs/version-3.8.0/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-3.8.0/globals/performance/timeOrigin.mdx deleted file mode 100644 index 772a527822..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/performance/timeOrigin.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.timeOrigin - -The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps. - -This value represents the time when the worker was instantiated. - -### Value - -Returns a number which represents the time when the worker was instantation. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.8.0/globals/setInterval.mdx b/documentation/versioned_docs/version-3.8.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-3.8.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-3.8.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-3.8.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-3.8.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-3.8.0/globals/undefined.mdx b/documentation/versioned_docs/version-3.8.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-3.8.0/globals/unescape.mdx b/documentation/versioned_docs/version-3.8.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-3.8.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-3.8.0/index.mdx b/documentation/versioned_docs/version-3.8.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-3.8.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-3.8.0/migration-guide/index.mdx b/documentation/versioned_docs/version-3.8.0/migration-guide/index.mdx deleted file mode 100644 index 543d0432cd..0000000000 --- a/documentation/versioned_docs/version-3.8.0/migration-guide/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# `Migrating from v2 to v3` - -## SimpleCache.delete renamed to SimpleCache.purge and requires purge options to be supplied as the second parameter - -We are renaming because "purge" is already a well-known and documented concept for removing content from Fastly's cache. - -The new addition of a second argument allows the caller to decide what scope to purge the content from, currently they can choose to purge from all of Fastly ("global") or from the POP that contains the currently executing instance ("pop"). We do not provide a default option right now, in the future we may provide a default option, if we discover a common pattern is being used. - -Here is an example of migrating an application using `SimpleCache.delete` to `SimpleCache.purge` with the same purging behaviour: -```diff -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request); - const path = url.pathname; - if (url.searchParams.has('delete')) { -- SimpleCache.delete(path); -+ SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - - -``` - - -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/Backend.mdx b/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/Backend.mdx deleted file mode 100644 index ec9c755f38..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/Backend.mdx +++ /dev/null @@ -1,227 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Backend()` - -The **`Backend` constructor** lets you dynamically create new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) for your Fastly Compute service. - -Dynamically creating new [Fastly Backends](https://developer.fastly.com/reference/api/services/backend/) is disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - -To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via: - -```js -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -``` - -**Note**: Backend constructors can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Backend(backendConfiguration) -``` - -> **Note:** `Backend()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `backendConfiguration` - - - : An Object which contains all the configuration options to apply to the newly created Backend. - - - `name` _: string_ - - The name of the backend. - - The name has to be between 1 and 254 characters inclusive. - - The name can be whatever you would like, as long as it does not match the name of any of the static service backends nor match any other dynamic backends built during a single execution of the application. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - - `target` _: string_ - - A hostname, IPv4, or IPv6 address for the backend as well as an optional port. - - The target has to be at-least 1 character. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. Is null, undefined, an empty string, not a valid IP address or host, or is the string `::` - - `hostOverride` _: string_ _**optional**_ - - If set, will force the HTTP Host header on connections to this backend to be the supplied value. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `connectTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for a connection to this backend to be established. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `firstByteTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. - - If exceeded, the connection is aborted and a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `betweenBytesTimeout` _: number_ _**optional**_ - - Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. - - If exceeded, the response received so far will be considered complete and the fetch will end. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is negative or greater than or equal to 2^32 - - `useSSL` _: boolean_ _**optional**_ - - Whether or not to require TLS for connections to this backend. - - `dontPool` _: boolean_ _**optional**_ - - Determine whether or not connections to the same backend should be pooled across different sessions. - - Fastly considers two backends “the same” if they're registered with the same name and the exact same settings. - - In those cases, when pooling is enabled, if Session 1 opens a connection to this backend it will be left open, and can be re-used by Session 2. - - This can help improve backend latency, by removing the need for the initial network / TLS handshake(s). - - By default, pooling is enabled for dynamic backends. - - `tlsMinVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Minimum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `tlsMaxVersion` _: 1 | 1.1 | 1.2 | 1.3_ _**optional**_ - - Maximum allowed TLS version on SSL connections to this backend. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - Throws a [`RangeError`](../../globals/RangeError/RangeError.mdx) if the value is not 1, 1.1, 1.2, or 1.3 - - `certificateHostname` _: string_ _**optional**_ - - Define the hostname that the server certificate should declare. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `caCertificate` _: string_ _**optional**_ - - The CA certificate to use when checking the validity of the backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `ciphers` _: string_ _**optional**_ - - List of OpenSSL ciphers to support for connections to this origin. - - If the backend server is not able to negotiate a connection meeting this constraint, a 503 response will be presented instead. - - [List of ciphers supported by Fastly](https://developer.fastly.com/learning/concepts/routing-traffic-to-fastly/#use-a-tls-configuration). - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - - `sniHostname` _: string_ _**optional**_ - - The SNI hostname to use on connections to this backend. - - Throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the value is an empty string. - -### Return value - -A new `Backend` object. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - - -In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client. - - - -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -import { Backend } from "fastly:backend"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - const backend = new Backend({ - name: 'fastly', - target: 'fastly.com', - hostOverride: "www.fastly.com", - connectTimeout: 1000, - firstByteTimeout: 15000, - betweenBytesTimeout: 10000, - useSSL: true, - sslMinVersion: 1.3, - sslMaxVersion: 1.3, - }); - return fetch('https://www.fastly.com/', { - backend // Here we are configuring this request to use the backend from above. - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - diff --git a/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/exists.mdx b/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/exists.mdx deleted file mode 100644 index d4d75b304f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/exists.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.exists() - -The **`Backend.exists()`** method returns a boolean indicating if a Backend with the given name exists or not. - -## Syntax - -```js -exists(name) -``` - -### Return value - -A boolean indicating if a Backend with the given name exists or not. diff --git a/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/fromName.mdx b/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/fromName.mdx deleted file mode 100644 index 471b6699dc..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/fromName.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.fromName() - -Returns the `Backend` instance with the given name, if one exists. If one does not exist, an error is thrown. - -## Syntax - -```js -fromName(name) -``` - -### Return value - -A `Backend` instance. diff --git a/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/health.mdx b/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/health.mdx deleted file mode 100644 index e4b39c9012..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/health.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.health() - -The **`Backend.health()`** method returns a string representing the health of the given Backend instance. - -## Syntax - -```js -Backend.health(backend) -``` - -### Return value - -A string representing the health of the specified Backend value. - -Possible values are: -- `"healthy"` - The backend's health check has succeeded, indicating the backend is working as expected and should receive requests. -- `"unhealthy"` - The backend's health check has failed, indicating the backend is not working as expected and should not receive requests. -- `"unknown"` - The backend does not have a health check configured. diff --git a/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/prototype/toName.mdx b/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/prototype/toName.mdx deleted file mode 100644 index f7667882de..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/prototype/toName.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Backend.prototype.toName() - -The **`toName()`** method returns the name associated with the `Backend` instance. - -## Syntax - -```js -toName() -``` - -### Return value - -A string which contains the name of the Backend. diff --git a/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/prototype/toString.mdx b/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/prototype/toString.mdx deleted file mode 100644 index 8dd7a21ec9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:backend/Backend/prototype/toString.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# toString - -The **`toString()`** method returns a string representing the specified Backend value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified Backend value. - -## Description - -The [Backend](../Backend.mdx) object overrides the `toString()` method of [Object](../../../globals//Object/Object.mdx); it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For [Backend](../Backend.mdx) values, the `toString` method returns the name given to the [Backend](../Backend.mdx) object during construction. - -The `toString()` method requires its `this` value to be a [Backend](../Backend.mdx) object. - -If the `this` value does not inherit from `Backend.prototype`, a [TypeError](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -### Using toString() - -The following example logs the string value of a [Backend](../Backend.mdx) object: - - -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -import { Backend } from "fastly:backend"; -async function app() { - const backend = new Backend({ - name: "fastly", - target: "fastly.com", - }); - console.log(backend.toString()); // "fastly" -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache-override/CacheOverride/CacheOverride.mdx b/documentation/versioned_docs/version-3.9.0/fastly:cache-override/CacheOverride/CacheOverride.mdx deleted file mode 100644 index e1495191d5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:cache-override/CacheOverride/CacheOverride.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `CacheOverride()` - -The **`CacheOverride` constructor** lets you configure the caching behavior of a `Response`. - -Normally, the HTTP Headers on a [`Response`](../../globals/Response/Response.mdx) would control how the [`Response`](../../globals/Response/Response.mdx) is cached, -but `CacheOverride` can be set on a [`Request`](../../globals/Request/Request.mdx), to define custom caching behavior. - -## Syntax - -```js -new CacheOverride(mode) -new CacheOverride(mode, init) -``` - -> **Note:** `CacheOverride()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `mode` _: string_ - - Sets the cache override mode for a request - - If set to: - - `"none"`: Do not override the behavior specified in the origin response’s cache control headers. - - `"pass"`: Do not cache the response to this request, regardless of the origin response’s headers. - - `"override"`: Override particular cache control settings using the `CacheOverride` object's settings. - -- `init` - - - : An Object which contains all the configuration options to apply to the newly created `CacheOverride`. - - - `pci` _: boolean_ _**optional**_ - - Override the caching behavior of this request to enable or disable PCI/HIPAA-compliant non-volatile caching. - - By default, this is `false`, which means the request may not be PCI/HIPAA-compliant. Set it to `true` to enable compliant caching. - - See the [Fastly PCI-Compliant Caching and Delivery documentation](https://docs.fastly.com/products/pci-compliant-caching-and-delivery) for details. - - - `surrogateKey` _: string_ _**optional**_ - - Override the caching behavior of this request to include the given surrogate key, provided as a header value. - - See the [Fastly surrogate keys guide](https://docs.fastly.com/en/guides/purging-api-cache-with-surrogate-keys) for details. - - `swr` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given `stale-while-revalidate` time, in seconds - - - `ttl` _: number_ _**optional**_ - - Override the caching behavior of this request to use the given Time to Live (TTL), in seconds. - -### Return value - -A new `CacheOverride` object. - -## Examples - -In this example we override the cache for all the requests prefixed /static/ to have a long TTL (Time To Live), and the home page to have a short TTL and a long SWR (Stale While Revalidate). - - -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { CacheOverride } from "fastly:cache-override"; -// In this example we override the cache for all the requests prefixed /static/ -// to have a long TTL (Time To Live), and the home page to have a short TTL and -// a long SWR (Stale While Revalidate). -async function app (event) { - const path = (new URL(event.request.url)).pathname; - let cacheOverride; - if (path == '/') { - cacheOverride = new CacheOverride('override', {ttl: 10, swr: 86_400}); - } else if (path.startsWith('/static/')) { - cacheOverride = new CacheOverride('override', {ttl: 86_400}); - } else { - cacheOverride = new CacheOverride('none') - } - return fetch(event.request.url, { - cacheOverride, - backend: 'origin_0' - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/SimpleCache.mdx b/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/SimpleCache.mdx deleted file mode 100644 index f4bf28b99e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/SimpleCache.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SimpleCache` - -The **`SimpleCache` class** provides a simplified interface to inserting and retrieving entries from Fastly's Cache. - -All the methods on the class are static methods, there are no instance methods. - - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, if the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/get.mdx b/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/get.mdx deleted file mode 100644 index f547ac00d2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/get.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.get - -▸ **get**(): `string` - -Gets the entry associated with the key `key` from the cache. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the cache. - -### Return value - -If the key does not exist in the cache, this returns `null`. - -If the key does exist in the cache, this returns a `SimpleCacheEntry`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache, and return a message stating whether the entry was in the Fastly Cache or not. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.get(path); - return new Response(page ? `${path} is in the cache` : `${path} is not in the cache`, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} -``` diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/getOrSet.mdx b/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/getOrSet.mdx deleted file mode 100644 index bb85d24c86..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/getOrSet.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCache.getOrSet - -The **`getOrSet()`** method attempts to get an entry from the cache for the supplied `key`. If no entry is found (or has expired), the supplied `set` function is executed and its result is inserted into the cache under the supplied `key` and for the supplied `ttl` (Time-To-Live) duration, provided in seconds. - -## Syntax - -```js -getOrSet(key, set) -getOrSet(key, set, length) -``` - -### Parameters - -- `key` _: string_ - - The key to lookup and/or store the supplied entry under within the cache. -- `set` _: Function_ - - The function to execute if and only if the cache does not have a usable entry for the supplied `key`. - The function should return a Promise which resolves with the following interface: - - `value` _: ArrayBuffer | TypedArray | DataView | ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the cache. - - `ttl` _: number_ - - The maximum number of seconds to store the supplied entry in the cache. - - `length` _: number_ __optional__ - - The length of the value being stored within the cache. This is only used when the `value` is a `ReadableStream`. - -### Return value - -Returns a `SimpleCacheEntry`. - -### Exceptions - -- If the provided `key`: - - Cannot be coerced to a string - - Is an empty string - - Is longer than 8135 characters -- If the provided `ttl`: - - Cannot be coerced to a number - - Is a negative number - - Is `NaN` - - Is Inifinity - -## Examples - -In this example we attempt to retrieve an entry from the Fastly Cache. If the entry does not exist, we create the content and insert it into the Fastly Cache before finally returning. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const path = new URL(event.request.url).pathname; - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/purge.mdx b/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/purge.mdx deleted file mode 100644 index 44ac6ff92c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCache/purge.mdx +++ /dev/null @@ -1,81 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# SimpleCache.purge - -purge the entry associated with the key `key` from the cache. - -## Syntax - -```js -purge(key, options) -``` - -### Parameters - -- `key` _: string_ - - The key to purge from within the cache. - -- `options` _: object_ - - `scope` _: string_ - - : Where to purge the content from. - - Possible values are: - - "global" - This will remove the content from all of Fastly. - - "pop" - This will remove the content from the POP that contains the currently executing instance. - -### Return value - -Returns `undefined`. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Cannot be coerced to a string - - Is longer than 8135 characters - -## Examples - -In this example, when a request contains a `purge` querystring parameter, we purge the an entry from the cache. - -```js -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request.url); - const path = url.pathname; - if (url.searchParams.has('purge')) { - SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - -``` diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx b/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx deleted file mode 100644 index 80deed4947..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.arrayBuffer() - -The **`arrayBuffer()`** method of the `SimpleCacheEntry` interface -takes the instance's stream and reads it to completion. It returns a promise -that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/body.mdx b/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/body.mdx deleted file mode 100644 index b9627e9091..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.body - -The **`body`** read-only property of the `SimpleCacheEntry` interface is a `ReadableStream` of the instance's contents. - -## Value - -A `ReadableStream`. - diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx b/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx deleted file mode 100644 index 8f44f22fd0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.bodyUsed - -The **`bodyUsed`** read-only property of the `SimpleCacheEntry` interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/json.mdx b/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/json.mdx deleted file mode 100644 index 84c6ca33a3..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.json() - -The **`json()`** method of the `SimpleCacheEntry` interface takes -a `SimpleCacheEntry` stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/text.mdx b/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/text.mdx deleted file mode 100644 index 7f8cb74819..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:cache/SimpleCacheEntry/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SimpleCacheEntry.text() - -The **`text()`** method of the `SimpleCacheEntry` interface takes the instance's stream and reads it to completion. -It returns a promise that resolves with a `String`. -The result is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. - diff --git a/documentation/versioned_docs/version-3.9.0/fastly:config-store/ConfigStore/ConfigStore.mdx b/documentation/versioned_docs/version-3.9.0/fastly:config-store/ConfigStore/ConfigStore.mdx deleted file mode 100644 index b5935719f1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:config-store/ConfigStore/ConfigStore.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `ConfigStore()` - -The **`ConfigStore` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -> **Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new ConfigStore(name); -``` - -> **Note:** `ConfigStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `ConfigStore` instance should provide access to. - -### Return value - -A new `ConfigStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Config Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:config-store/ConfigStore/prototype/get.mdx b/documentation/versioned_docs/version-3.9.0/fastly:config-store/ConfigStore/prototype/get.mdx deleted file mode 100644 index 295fb3acf7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:config-store/ConfigStore/prototype/get.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# ConfigStore.prototype.get - -The **`get()`** method returns the value associated with the provided key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified ConfigStore value or `null` if the key does not exist in the ConfigStore - -## Description - -Get a value for a key in the config-store. If the provided key does not exist in the ConfigStore then this returns `null`. - -The `get()` method requires its `this` value to be a [`ConfigStore`](../../../fastly%3Aconfig-store/ConfigStore/ConfigStore.mdx) object. - -If the `this` value does not inherit from `ConfigStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { ConfigStore } from "fastly:config-store"; -async function app (event) { - const config = new ConfigStore('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:dictionary/Dictionary/Dictionary.mdx b/documentation/versioned_docs/version-3.9.0/fastly:dictionary/Dictionary/Dictionary.mdx deleted file mode 100644 index 71d4e171c0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:dictionary/Dictionary/Dictionary.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Dictionary()` - -The **`Dictionary` constructor** lets you access a specific [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Dictionary(name); -``` - -> **Note:** `Dictionary()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The name of the [Fastly Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) that this `Dictionary` instance should provide access to. - -### Return value - -A new `Dictionary` object. - -### Exceptions - -- `TypeError` - - Thrown if no Dictionary exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name does not contain only ascii alphanumeric, underscore, and whitespace characters - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:dictionary/Dictionary/prototype/get.mdx b/documentation/versioned_docs/version-3.9.0/fastly:dictionary/Dictionary/prototype/get.mdx deleted file mode 100644 index 670bf31eca..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:dictionary/Dictionary/prototype/get.mdx +++ /dev/null @@ -1,101 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Dictionary.prototype.get - -▸ **get**(): `string` - -Returns the name of the Dictionary instance - -The **`get()`** method returns the value associated with the provided key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from the dictionary. - -### Return value - -A `string` representing the specified Dictionary value or `null` if the key does not exist in the Dictionary - -## Description - -Get a value for a key in the dictionary. If the provided key does not exist in the Dictionary then this returns `null`. - -The `get()` method requires its `this` value to be a [`Dictionary`](../Dictionary.mdx) object. - -If the `this` value does not inherit from `Dictionary.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - Thrown if the provided key is longer than 255 in length - - Thrown if the provided key is an empty string - -## Examples - -In this example we have an Edge Dictionary named "animals" and we return the "cat" entry as the response body to the client. - - -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Dictionary } from "fastly:dictionary"; -async function app (event) { - const config = new Dictionary('animals'); - return new Response(config.get('cat')); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:env/env.mdx b/documentation/versioned_docs/version-3.9.0/fastly:env/env.mdx deleted file mode 100644 index 2e6f33bda9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:env/env.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# env - -The **`env()`** function returns the value for the provided environment variable name. - -For a list of available environment variables, see the [Fastly Developer Hub for Compute Environment Variables](https://developer.fastly.com/reference/compute/ecp-env/) - ->**Note**: The environment variables can only be retrieved when processing requests, not during build-time initialization. - -## Syntax - -```js -env(name) -``` - -### Parameters - -- `name` _: string_ - - The name of the environment variable to retrieve - -### Return value - -The value for the requested environment variable, if no such environment variable exists then an empty string is returned. - -## Examples - -In this example we log to stdout the environment variables [`FASTLY_HOSTNAME`](https://developer.fastly.com/reference/compute/ecp-env/fastly-hostname/) and [`FASTLY_TRACE_ID`](https://developer.fastly.com/reference/compute/ecp-env/fastly-trace-id/). - - -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { env } from "fastly:env"; -function app(event) { - console.log("FASTLY_HOSTNAME:", env("FASTLY_HOSTNAME")); - console.log("FASTLY_TRACE_ID:", env("FASTLY_TRACE_ID")); - return new Response("", { - status: 200 - }); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:experimental/allowDynamicBackends.mdx b/documentation/versioned_docs/version-3.9.0/fastly:experimental/allowDynamicBackends.mdx deleted file mode 100644 index 8df43ba04d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:experimental/allowDynamicBackends.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# allowDynamicBackends - -The **`allowDynamicBackends()`** function is used to control whether or not Dynamic Backends should be allowed within this Fastly Compute Service. - -By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue. - ->**Note**: This feature is in disabled by default for Fastly Services. Please contact [Fastly Support](https://support.fastly.com/hc/requests/new?ticket_form_id=360000269711) to request the feature be enabled on the Fastly Services which require Dynamic Backends. - -## Syntax - -```js -allowDynamicBackends(enabled) -``` - -### Parameters - -- `enabled` _: boolean_ - - Whether or not to allow Dynamic Backends - -### Return value - -`undefined`. - -## Examples - -In this example an implicit Dynamic Backend is created when making the fetch request to and the response is then returned to the client. - - -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { allowDynamicBackends } from "fastly:experimental"; -allowDynamicBackends(true); -async function app() { - // For any request, return the fastly homepage -- without defining a backend! - return fetch('https://www.fastly.com/'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:experimental/includeBytes.mdx b/documentation/versioned_docs/version-3.9.0/fastly:experimental/includeBytes.mdx deleted file mode 100644 index 9ec78512a6..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:experimental/includeBytes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# includeBytes - -The **`includeBytes()`** function is used embed a file as a Uint8Array. - ->**Note**: Can only be used during build-time initialization, not when processing requests. - -## Syntax - -```js -includeBytes(path) -``` - -### Parameters - -- `path` _: string_ - - The path to include, relative to the Fastly Compute application's top-level directory during build-time initialization. - -### Return value - -Returns a `Uint8Array` - -## Examples - -In this example we include the README.md file as a Uint8Array and use it for the body in the response we return to the client. - -```js -/// -import { includeBytes } from "fastly:experimental"; -const readme = includeBytes('README.md'); -async function app() { - return new Response(readme); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` diff --git a/documentation/versioned_docs/version-3.9.0/fastly:fanout/createFanoutHandoff.mdx b/documentation/versioned_docs/version-3.9.0/fastly:fanout/createFanoutHandoff.mdx deleted file mode 100644 index f236ec6cfe..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:fanout/createFanoutHandoff.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# createFanoutHandoff - -The **`createFanoutHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Fanout, to the declared backend. - -## Syntax - -```js -createFanoutHandoff(request, backend) -``` - -### Parameters - -- `request` _: Request_ - - The request to pass through Fanout. -- `backend` _: string_ - - The name of the backend that Fanout should send the request to. - - The name has to be between 1 and 254 characters inclusive. - - Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters. - -### Return value - -A Response instance is returned, which can then be used via `event.respondWith`. - -## Examples - -In this example application requests to the path `/stream` and sent handled via Fanout. - -```js -import { createFanoutHandoff } from "fastly:fanout"; - -async function handleRequest(event) { - try { - const url = new URL(event.request.url); - if (url.pathname === '/stream') { - return createFanoutHandoff(event.request, 'fanout'); - } else { - return new Response('oopsie, make a request to /stream for some fanout goodies', { status: 404 }); - } - } catch (error) { - console.error({error}); - return new Response(error.message, {status:500}) - } -} - -addEventListener("fetch", (event) => event.respondWith(handleRequest(event))); -``` diff --git a/documentation/versioned_docs/version-3.9.0/fastly:geolocation/getGeolocationForIpAddress.mdx b/documentation/versioned_docs/version-3.9.0/fastly:geolocation/getGeolocationForIpAddress.mdx deleted file mode 100644 index d47ed998ab..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:geolocation/getGeolocationForIpAddress.mdx +++ /dev/null @@ -1,178 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# getGeolocationForIpAddress - -The **`getGeolocationForIpAddress()`** function is used to retrieve geolocation information about the given IP address. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -getGeolocationForIpAddress(address) -``` - -### Parameters - -- `address` _: string_ - - The IPv4 or IPv6 address to query. - -### Return value - -Returns an `Object` which contains information about the given IP address with the following properties: - -- `as_name` _: string | null_ - - The name of the organization associated with `as_number`. - - For example, fastly is the value given for IP addresses under AS-54113. - -- `as_number` _: number | null_ - - [Autonomous system](https://en.wikipedia.org/wiki/Autonomous_system_(Internet)) (AS) number. - -- `area_code` _: number | null_ - - The telephone area code associated with an IP address. - - These are only available for IP addresses in the United States, its territories, and Canada. - -- `city` _: string | null_ - - City or town name. - -- `conn_speed` _: string | null_ - - Connection speed. - -- `conn_type` _: string | null_ - - Connection type. - -- `continent` _: string | null_ - - Continent. - -- `country_code` _: string | null_ - - A two-character [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) country code for the country associated with an IP address. - - The US country code is returned for IP addresses associated with overseas United States military bases. - - These values include subdivisions that are assigned their own country codes in ISO 3166-1. For example, subdivisions NO-21 and NO-22 are presented with the country code SJ for Svalbard and the Jan Mayen Islands. - -- `country_code3` _: string | null_ - - A three-character [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country code for the country associated with the IP address. - - The USA country code is returned for IP addresses associated with overseas United States military bases. - -- `country_name` _: string | null_ - - Country name. - - This field is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) English short name for a country. - -- `gmt_offset` _: string | null_ - - Time zone offset from Greenwich Mean Time (GMT) for `city`. - -- `latitude` _: number | null_ - - Latitude, in units of degrees from the equator. - - Values range from -90.0 to +90.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `longitude` _: number | null_ - - Longitude, in units of degrees from the [IERS Reference Meridian](https://en.wikipedia.org/wiki/IERS_Reference_Meridian). - - Values range from -180.0 to +180.0 inclusive, and are based on the [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System) coordinate reference system. - -- `metro_code` _: number | null_ - - Metro code, representing designated market areas (DMAs) in the United States. - -- `postal_code` _: string | null_ - - The postal code associated with the IP address. - - These are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, the United Kingdom, and the United States. - - For Canadian postal codes, this is the first 3 characters. For the United Kingdom, this is the first 2-4 characters (outward code). For countries with alphanumeric postal codes, this field is a lowercase transliteration. - -- `proxy_description` _: string | null_ - - Client proxy description. - -- `proxy_type` _: string | null_ - - Client proxy type. - -- `region` _: string | null_ - - [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) country subdivision code. - - For countries with multiple levels of subdivision (for example, nations within the United Kingdom), this variable gives the more specific subdivision. - - This field can be None for countries that do not have ISO country subdivision codes. For example, None is given for IP addresses assigned to the Åland Islands (country code AX, illustrated below). - -- `utc_offset` _: number | null;_ - - Time zone offset from coordinated universal time (UTC) for `city`. - -## Examples - -In this example we return the geolocation details for the provided ip querystring parameter or for the incoming client request if the querystring parameter does not exist. - - -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "data": { - "dictionaries": { - "animals": { - "cat": "meow" - } - } - }, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { getGeolocationForIpAddress } from "fastly:geolocation" -async function app(event) { - try { - let ip = new URL(event.request.url).searchParams.get('ip') || event.client.address - let geo = getGeolocationForIpAddress(ip); - return new Response(JSON.stringify(geo), { - headers: { - "Content-Type": "application/json", - }, - }); - } catch (error) { - console.error(error); - return new Response("Internal Server Error", { - status: 500 - }); - } -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStore/KVStore.mdx b/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStore/KVStore.mdx deleted file mode 100644 index 6cac3d4b05..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStore/KVStore.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `KVStore()` - -The **`KVStore` constructor** lets you connect your Fastly Compute application to a Fastly KV store. - -A Fastly KV store is a persistent, globally consistent key-value store. See [Data stores for Fastly services](https://developer.fastly.com/learning/concepts/edge-state/data-stores#kv-stores) for initialization and usage details. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new KVStore(name) -``` - -> **Note:** `KVStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly KV store which should be associated with this KVStore instance - -### Return value - -A new `KVStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no KV Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name does not start with an ascii alphabetical character - - Thrown if the provided name contains control characters `(\u0000-\u001F)` - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStore/prototype/get.mdx b/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStore/prototype/get.mdx deleted file mode 100644 index 956ddbeda5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStore/prototype/get.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the KV store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the KV-store. - -### Return value - -If the key does not exist in the KV store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the KV store, this returns a `Promise` which resolves with an `KVStoreEntry`. - -## Description - -Send the given message, converted to a string, to this KVStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStore/prototype/put.mdx b/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStore/prototype/put.mdx deleted file mode 100644 index 9504041ce1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStore/prototype/put.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# KVStore.prototype.put - -The **`put()`** method stores a `value` into the KV store under a `key`. - -> **Note**: KV stores are eventually consistent, this means that the updated contents associated with the key `key` may not be available to read from all edge locations immediately and some edge locations may continue returning the previous contents associated with the key. - -## Syntax - -```js -put(key, value) -``` - -### Parameters - -- `key` _: string_ - - The key to store the supplied value under within the KV store. -- `value` _: ArrayBuffer | TypedArray | DataView| ReadableStream | URLSearchParams | String | string literal_ - - The value to store within the KV store. - -### Return value - -Returns a `Promise` which resolves with `undefined` when the provided `value` has been written into the KV store. - -## Description - -Stores the supplied `value` into the KV store under the supplied `key`. - -The `put()` method requires its `this` value to be a [`KVStore`](../KVStore.mdx) object. - -If the `this` value does not inherit from `KVStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is any of the strings `""`, `"."`, or `".."` - - Starts with the string `".well-known/acme-challenge/"` - - Contains any of the characters `"#?*[]\n\r"` - - Is longer than 1024 characters - -## Examples - -In this example we connect to an KV Store named `'files'` and save an entry to the store under the key `'hello'` and then read back the value and return it to the client. - -```js -/// - -import { KVStore } from "fastly:kv-store"; - -async function app(event) { - const files = new KVStore('files') - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx deleted file mode 100644 index a79b301039..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.arrayBuffer() - -The `arrayBuffer()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with an `ArrayBuffer`. -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx b/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx deleted file mode 100644 index 42378097e3..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.body - -The `body` read-only property of the `KVStoreEntry` interface is a `ReadableStream` of the body contents. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx deleted file mode 100644 index ed887185bc..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/bodyUsed.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.bodyUsed - -The `bodyUsed` read-only property of the `KVStoreEntry` interface is a `boolean` value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx b/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx deleted file mode 100644 index 0273ebc2fe..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/json.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.json() - -The `json()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx b/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx deleted file mode 100644 index b03179f8ac..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:kv-store/KVStoreEntry/prototype/text.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# KVStoreEntry.text() - -The `text()` method of the `KVStoreEntry` interface takes a `KVStoreEntry` stream and reads it to completion. It returns a promise that resolves with a `String`. The `KVStoreEntry `is always decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves with a `String`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:logger/Logger/Logger.mdx b/documentation/versioned_docs/version-3.9.0/fastly:logger/Logger/Logger.mdx deleted file mode 100644 index 8c6d951886..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:logger/Logger/Logger.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# `Logger()` - -The **`Logger` constructor** lets you connect your Fastly Compute application to a [Fastly Named Logger](https://developer.fastly.com/learning/integrations/logging/). - -**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new Logger(name) -``` - -> **Note:** `Logger()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Logger which should be associated with this Logger instance - -### Return value - -A new `Logger` object. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:logger/Logger/prototype/log.mdx b/documentation/versioned_docs/version-3.9.0/fastly:logger/Logger/prototype/log.mdx deleted file mode 100644 index 731bedf4d8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:logger/Logger/prototype/log.mdx +++ /dev/null @@ -1,89 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -import {Fiddle} from '@site/src/components/fiddle'; - -# Logger.prototype.log - -▸ **log**(): `string` - -Sends the given message, converted to a string, to this Logger instance's endpoint. - -## Syntax - -```js -log(message) -``` - -### Return value - -`undefined`. - -## Description - -Send the given message, converted to a string, to this Logger instance's endpoint. - -The `log()` method requires its `this` value to be a [`Logger`](../Logger.mdx) object. - -If the `this` value does not inherit from `Logger.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we have a create a logger named `"splunk"` and logs the incoming request method and destination. - - -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// -import { Logger } from "fastly:logger"; -async function app (event) { - let logger = new Logger("splunk"); - logger.log(JSON.stringify({ - method: event.request.method, - url: event.request.url - })); - return new Response('OK'); -} -addEventListener("fetch", event => event.respondWith(app(event))); -``` - - \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/fastly:secret-store/SecretStore/SecretStore.mdx b/documentation/versioned_docs/version-3.9.0/fastly:secret-store/SecretStore/SecretStore.mdx deleted file mode 100644 index 43f30f9d86..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:secret-store/SecretStore/SecretStore.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# `SecretStore()` - -The **`SecretStore` constructor** lets you connect your Fastly Compute application to a Fastly Secret store. - -A secret store is a persistent, globally distributed store for secrets accessible to Fastly Compute services during request processing. - ->**Note**: Can only be used when processing requests, not during build-time initialization. - -## Syntax - -```js -new SecretStore(name) -``` - -> **Note:** `SecretStore()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `name` _: string_ - - The Fastly Secret Store which should be associated with this SecretStore instance - -### Return value - -A new `SecretStore` object. - -### Exceptions - -- `TypeError` - - Thrown if no Secret Store exists with the provided name - - Thrown if the provided name is longer than 255 in length - - Thrown if the provided name is an empty string - - Thrown if the provided name contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.9.0/fastly:secret-store/SecretStore/prototype/get.mdx b/documentation/versioned_docs/version-3.9.0/fastly:secret-store/SecretStore/prototype/get.mdx deleted file mode 100644 index 72f41d5d84..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:secret-store/SecretStore/prototype/get.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStore.prototype.get - -▸ **get**(): `string` - -Gets the value associated with the key `key` in the Secret store. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` _: string_ - - The key to retrieve from within the Secret Store. - -### Return value - -If the key does not exist in the Secret Store, this returns a `Promise` which resolves with `null`. - -If the key does exist in the Secret Store, this returns a `Promise` which resolves with an `SecretStoreEntry`. - -## Description - -Send the given message, converted to a string, to this SecretStore instance's endpoint. - -The `get()` method requires its `this` value to be a [`SecretStore`](../SecretStore.mdx) object. - -If the `this` value does not inherit from `SecretStore.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Exceptions - -- `TypeError` - - If the provided `key`: - - Is an empty string - - Is longer than 255 characters - - Contains characters other than letters, numbers, dashes (-), underscores (_), and periods (.) - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.9.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx b/documentation/versioned_docs/version-3.9.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx deleted file mode 100644 index d903471b89..0000000000 --- a/documentation/versioned_docs/version-3.9.0/fastly:secret-store/SecretStoreEntry/prototype/plaintext.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SecretStoreEntry.prototype.plaintext - -▸ **plaintext**(): `string` - -Returns the plaintext contents of the SecretStoreEntry instance as String. - -## Syntax - -```js -plaintext() -``` - -### Parameters - -None. - -### Return value - -A String - -### Exceptions - -The `plaintext()` method requires its `this` value to be a `SecretStoreEntry` object. -If the `this` value does not inherit from `SecretStoreEntry.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -## Examples - -In this example we connect to a Secret Store named `'secrets'` and retrieve a secret named `'cat-api-key'` use the value in a Request header. - -```js -/// - -import { SecretStore } from "fastly:secret-store"; - -async function app(event) { - const secrets = new SecretStore('secrets') - - const catApiKey = await secrets.get('cat-api-key') - - return fetch('/api/cat', { - headers: { - 'cat-api-key': catApiKey.plaintext() - } - }) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) - -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/AggregrateError/AggregrateError.mdx b/documentation/versioned_docs/version-3.9.0/globals/AggregrateError/AggregrateError.mdx deleted file mode 100644 index e27ca94f80..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/AggregrateError/AggregrateError.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# AggregateError() - -The **`AggregateError()`** constructor creates an error for several errors that need to be wrapped in a single error. - -## Syntax - -```js -new AggregateError(errors) -new AggregateError(errors, message) -new AggregateError(errors, message, options) - -AggregateError(errors) -AggregateError(errors, message) -AggregateError(errors, message, options) -``` - -> **Note:** `AggregateError()` can be called with or without `new`. Both create a new `AggregateError` instance. - -### Parameters - -- `errors` - - : An iterable of errors, may not actually be [`TypeError`](../Error/Error.mdx) instances. -- `message` _**optional**_ - - : An optional human-readable description of the aggregate error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/@@species.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/@@species.mdx deleted file mode 100644 index 21dca62c54..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/@@species.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array\[Symbol.species] - -The **`Array[Symbol.species]`** accessor property returns the constructor used to construct return values from array methods. - -> **Warning:** The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Array[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array methods that create new arrays. - -## Description - -The `[Symbol.species]` accessor property returns the default constructor for `Array` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Array { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `[Symbol.species]` of derived subclasses would also return the constructor itself by default. - -```js -class SubArray extends Array {} -SubArray[Symbol.species] === SubArray; // true -``` - -When calling array methods that do not mutate the existing array but return a new array instance (for example, `filter()` and `map()`), the array's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array method. This makes it technically possible to make array methods return objects unrelated to arrays. - -```js -class NotAnArray { - constructor(length) { - this.length = length; - } -} - -const arr = [0, 1, 2]; -arr.constructor = { [Symbol.species]: NotAnArray }; -arr.map((i) => i); // NotAnArray { '0': 0, '1': 1, '2': 2, length: 3 } -arr.filter((i) => i); // NotAnArray { '0': 1, '1': 2, length: 0 } -arr.concat([1, 2]); // NotAnArray { '0': 0, '1': 1, '2': 2, '3': 1, '4': 2, length: 5 } -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/Array.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/Array.mdx deleted file mode 100644 index a08672f15a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/Array.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array() - -The **`Array()`** constructor is used to create `Array` objects. - -## Syntax - -```js -new Array(element0, element1, /* … ,*/ elementN) -new Array(arrayLength) - -Array(element0, element1, /* … ,*/ elementN) -Array(arrayLength) -``` - -> **Note:** `Array()` can be called with or without `new`. Both create a new `Array` instance. - -### Parameters - -- `elementN` - - : A JavaScript array is initialized with the given elements, except in the case where - a single argument is passed to the `Array` constructor and that argument is - a number (see the `arrayLength` parameter below). Note that this special case only - applies to JavaScript arrays created with the `Array` constructor, not - array literals created with the bracket syntax. -- `arrayLength` - - : If the only argument passed to the `Array` constructor is an integer - between 0 and 232 - 1 (inclusive), this returns a new JavaScript array with - its `length` property set to that number (**Note:** this - implies an array of `arrayLength` empty slots, not slots with actual - `undefined` values). - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if there's only one argument (`arrayLength`) and its value is not between 0 and 232 - 1 (inclusive). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/from.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/from.mdx deleted file mode 100644 index f4c3e0c4e6..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/from.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.from - -The **`Array.from()`** static method creates a new, shallow-copied `Array` instance from an iterable or array-like object. - -## Syntax - -```js -Array.from(arrayLike) - -// Arrow function -Array.from(arrayLike, (element) => { /* … */ }) -Array.from(arrayLike, (element, index) => { /* … */ }) - -// Mapping function -Array.from(arrayLike, mapFn) -Array.from(arrayLike, mapFn, thisArg) - -// Inline mapping function -Array.from(arrayLike, function (element) { /* … */ }) -Array.from(arrayLike, function (element, index) { /* … */ }) -Array.from(arrayLike, function (element) { /* … */ }, thisArg) -Array.from(arrayLike, function (element, index) { /* … */ }, thisArg) -``` - -### Parameters - -- `arrayLike` - - : An iterable or array-like object to convert to an array. -- `mapFn` _**optional**_ - - - : Map function to call on every element of the array. If provided, every value to be added to the array is first passed through this function, and `mapFn`'s return value is added to the array instead. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `mapFn`. - -### Return value - -A new `Array` instance. - -## Description - -`Array.from()` lets you create `Array`s from: - -- [iterable objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) (objects such as [`Map`](../Map/Map.mdx) and [`Set`](../Set/Set.mdx); or, if the object is not iterable, -- array-like objects (objects with a `length` property and indexed elements). - -`Array.from()` never creates a sparse array. If the `arrayLike` object is missing some index properties, they become `undefined` in the new array. - -`Array.from()` has an optional parameter `mapFn`, which allows you to execute a function on each element of the array being created, similar to [`Array.prototype.map()`](./prototype/map.mdx). More clearly, `Array.from(obj, mapFn, thisArg)` has the same result as `Array.from(obj).map(mapFn, thisArg)`, except that it does not create an intermediate array, and `mapFn` only receives two arguments (`element`, `index`) without the whole array, because the array is still under construction. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/isArray.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/isArray.mdx deleted file mode 100644 index 848da01bb8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/isArray.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.isArray() - -The **`Array.isArray()`** static method determines whether the passed value is an `Array`. - -## Syntax - -```js -Array.isArray(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if `value` is an `Array`; otherwise, `false`. `false` is always returned if `value` is a `TypedArray` instance. - -## Description - -`Array.isArray()` checks if the passed value is an `Array`. It does not check the value's prototype chain, nor does it rely on the `Array` constructor it is attached to. It returns `true` for any value that was created using the array literal syntax or the `Array` constructor. This makes it safe to use with cross-realm objects, where the identity of the `Array` constructor is different and would therefore cause `instanceof Array` to fail. - -See the article ["Determining with absolute accuracy whether or not a JavaScript object is an array"](https://web.mit.edu/jwalden/www/isArray.html) for more details. - -`Array.isArray()` also rejects objects with `Array.prototype` in its prototype chain but aren't actual arrays, which `instanceof Array` would accept. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/of.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/of.mdx deleted file mode 100644 index 0fc47761ed..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/of.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.of() -The **`Array.of()`** method creates a new `Array` -instance from a variable number of arguments, regardless of number or type of the -arguments. - -## Syntax - -```js -Array.of(element0) -Array.of(element0, element1) -Array.of(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : Elements used to create the array. - -### Return value - -A new `Array` instance. - -## Description - -The difference between `Array.of()` and the [`Array()`](./Array.mdx) constructor is in the handling of single arguments: `Array.of(7)` creates an array with a single element, `7`, whereas `Array(7)` creates an empty array with a `length` property of `7`. (That implies an array of 7 empty slots, not slots with actual [`undefined`](../undefined.mdx) values.) - -```js -Array.of(7); // [7] -Array(7); // array of 7 empty slots - -Array.of(1, 2, 3); // [1, 2, 3] -Array(1, 2, 3); // [1, 2, 3] -``` - -The `Array.of()` method is a generic factory method. For example, if a subclass of `Array` inherits the `of()` method, the inherited `of()` method will return new instances of the subclass instead of `Array` instances. In fact, the `this` value can be any constructor function that accepts a single argument representing the length of the new array, and the constructor will be called with the number of arguments passed to `of()`. The final `length` will be set again when all elements are assigned. If the `this` value is not a constructor function, the plain `Array` constructor is used instead. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/@@iterator.mdx deleted file mode 100644 index b49c9f766e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of an `Array` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows arrays to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the value of each index in the array. - -The initial value of this property is the same function object as the initial value of the [`Array.prototype.values`](./values.mdx) property. - -## Syntax - -```js -array[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Array.prototype.values()`](./values.mdx): a new iterable iterator object that yields the value of each index in the array. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/@@unscopables.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/@@unscopables.mdx deleted file mode 100644 index 70125922cc..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/@@unscopables.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype[Symbol.unscopables] - -The **`@@unscopables`** data property of `Array.prototype` is shared by all `Array` instances. It contains property names that were not included in the ECMAScript standard prior to the ES2015 version and that are ignored for [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) statement-binding purposes. - -## Value - -A [`null`-prototype object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects) with property names given below and their values set to `true`. - -## Description - -The default `Array` properties that are ignored for `with` statement-binding purposes are: - -- [`at()`](./at.mdx) -- [`copyWithin()`](./copyWithin.mdx) -- [`entries()`](./entries.mdx) -- [`fill()`](./fill.mdx) -- [`find()`](./find.mdx) -- [`findIndex()`](./findIndex.mdx) -- [`flat()`](./flat.mdx) -- [`flatMap()`](./flatMap.mdx) -- [`includes()`](./includes.mdx) -- [`keys()`](./keys.mdx) -- [`values()`](./values.mdx) - -`Array.prototype[@@unscopables]` is an empty object only containing all the above property names with the value `true`. Its [prototype is `null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects), so `Object.prototype` properties like [`toString`](../../Object/prototype/toString.mdx) won't accidentally be made unscopable, and a `toString()` within the `with` statement will continue to be called on the array. - -See [`Symbol.unscopables`](../../Symbol/unscopables.mdx) for how to set unscopable properties for your own objects. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/at.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/at.mdx deleted file mode 100644 index 72daaa0ac5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/at.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.at - -The **`at()`** method takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : Zero-based index of the array element to be returned, converted to an integer. Negative index counts back from the end of the array — if `index < 0`, `index + array.length` is accessed. - -### Return value - -The element in the array matching the given index. Always returns [`undefined`](../../../globals/undefined.mdx) if `index < -array.length` or `index >= array.length` without attempting to access the corresponding property. - -## Description - -The `at()` method is equivalent to the bracket notation when `index` is non-negative. For example, `array[0]` and `array.at(0)` both return the first item. However, when counting elements from the end of the array, you cannot use `array[-1]` like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading `array["-1"]`, which is just a normal string property instead of an array index. - -The usual practice is to access [`Array.prototype.length`](./length.mdx) and calculate the index from that — for example, `array[array.length - 1]`. The `at()` method allows relative indexing, so this can be shortened to `array.at(-1)`. - -The `at()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/concat.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/concat.mdx deleted file mode 100644 index d2892232e7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/concat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.concat - -The **`concat()`** method is used to merge two or more arrays. -This method does not change the existing arrays, but instead returns a new array. - -## Syntax - -```js -concat() -concat(value0) -concat(value0, value1) -concat(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `valueN` _**optional**_ - - : Arrays and/or values to concatenate into a new array. If all - `valueN` parameters are omitted, `concat` returns a - [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of the existing array on which it is called. See the description below - for more details. - -### Return value - -A new `Array` instance. - -## Description - -The `concat` method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property [`Symbol.isConcatSpreadable`](../../Symbol/isConcatSpreadable.mdx) set to a truthy value, each element of the argument will be independently added to the final array. The `concat` method does not recurse into nested array arguments. - -The `concat()` method is a copying. It does not alter `this` or any of the arrays provided as arguments but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original arrays. - -The `concat()` method preserves empty slots if any of the source arrays is sparse. - -The `concat()` method is generic. The `this` value is treated in the same way as the other arguments (except it will be converted to an object first), which means plain objects will be directly prepended to the resulting array, while array-like objects with truthy `Symbol.isConcatSpreadable` will be spread into the resulting array. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/copyWithin.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/copyWithin.mdx deleted file mode 100644 index c008879349..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/copyWithin.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.copyWithin - -The **`copyWithin()`** method shallow copies part of an array -to another location in the same array and returns it without modifying its length. - - - -## Syntax - -```js -copyWithin(target) -copyWithin(target, start) -copyWithin(target, start, end) -``` - -### Parameters - -- `target` - - : Zero-based index at which to copy the sequence to, converted to an integer. - - Negative index counts back from the end of the array — if `target < 0`, `target + array.length` is used. - - If `target < -array.length`, `0` is used. - - If `target >= array.length`, nothing is copied. - - If `target` is positioned after `start` after normalization, copying only happens until the end of `array.length` (in other words, `copyWithin()` never extends the array). -- `start` _**optional**_ - - : Zero-based index at which to start copying elements from, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is copied. -- `end` _**optional**_ - - : Zero-based index at which to end copying elements from, converted to an integer. `copyWithin()` copies up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be copied. - - If `end` is positioned before or at `start` after normalization, nothing is copied. - -### Return value - -The modified array. - -## Description - -The `copyWithin()` method works like C and C++'s `memmove`, and is a high-performance method to shift the data of an `Array`. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap. - -The `copyWithin()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this` and create new properties or delete existing properties, if necessary. - -The `copyWithin()` method preserves empty slots. If the region to be copied from is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `copyWithin()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/entries.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/entries.mdx deleted file mode 100644 index 954fc63b1f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.entries - -The **`entries()`** method returns a new **Array -Iterator** object that contains the key/value pairs for each index in the -array. - -## Syntax - -```js -entries() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `entries()` method iterates empty slots as if they have the value `undefined`. - -The `entries()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/every.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/every.mdx deleted file mode 100644 index f8a4de7880..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/every.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.every - -The **`every()`** method tests whether -all elements in the array pass the test implemented by the provided function. It -returns a Boolean value. - -## Syntax - -```js -// Arrow function -every((element) => { /* … */ }) -every((element, index) => { /* … */ }) -every((element, index, array) => { /* … */ }) - -// Callback function -every(callbackFn) -every(callbackFn, thisArg) - -// Inline callback function -every(function (element) { /* … */ }) -every(function (element, index) { /* … */ }) -every(function (element, index, array) { /* … */ }) -every(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `every()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for every array element. Otherwise, `false`. - -## Description - -The `every()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value. If such an element is found, `every()` immediately returns `false` and stops iterating through the array. Otherwise, if `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for all elements, `every()` returns `true`. - -`every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns `true`. (It is [vacuously true](https://en.wikipedia.org/wiki/Vacuous_truth) that all elements of the [empty set](https://en.wikipedia.org/wiki/Empty_set#Properties) satisfy any given condition.) - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`every()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `every()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `every()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/fill.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/fill.mdx deleted file mode 100644 index 83564660fd..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/fill.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.fill - -The **`fill()`** method changes all elements in an array to a static value, from a start index (default `0`) to an end index (default `array.length`). -It returns the modified array. - -## Syntax - -```js -fill(value) -fill(value, start) -fill(value, start, end) -``` - -### Parameters - -- `value` - - : Value to fill the array with. Note all elements in the array will be this exact value: if `value` is an object, each slot in the array will reference that object. -- `start` _**optional**_ - - : Zero-based index at which to start filling, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no index is filled. -- `end` _**optional**_ - - : Zero-based index at which to end filling, converted to an integer. `fill()` fills up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all indices until the end to be filled. - - If `end` is positioned before or at `start` after normalization, no index is filled. - -### Return value - -The modified array, filled with `value`. - -## Description - -The `fill()` method is a mutating method. It does not alter the length of `this`, but it will change the content of `this`. - -The `fill()` method fills empty slots in sparse arrays with `value` as well. - -The `fill()` method is generic. It only expects the `this` value to have a `length` property. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/filter.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/filter.mdx deleted file mode 100644 index 37c60f1dfb..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/filter.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.filter - -The **`filter()`** method creates a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of a given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. - -## Syntax - -```js -// Arrow function -filter((element) => { /* … */ }) -filter((element, index) => { /* … */ }) -filter((element, index, array) => { /* … */ }) - -// Callback function -filter(callbackFn) -filter(callbackFn, thisArg) - -// Inline callback function -filter(function (element) { /* … */ }) -filter(function (element, index) { /* … */ }) -filter(function (element, index, array) { /* … */ }) -filter(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to keep the element in the resulting array, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `filter()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. - -## Description - -The `filter()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, and constructs a new array of all the values for which `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. Array elements which do not pass the `callbackFn` test are not included in the new array. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `filter()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array (with some filtered out). However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `filter()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `filter()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/find.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/find.mdx deleted file mode 100644 index 7dad46af5e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/find.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.find() - -The `find()` method returns the first element in the provided array that satisfies the provided testing function. -If no values satisfy the testing function, [`undefined`](../../../globals/undefined.mdx) is returned. - -- If you need the **index** of the found element in the array, use [`findIndex()`](./findIndex.mdx). -- If you need to find the **index of a value**, use [`indexOf()`](./indexOf.mdx). - (It's similar to [`findIndex()`](./findIndex.mdx), but checks each element for equality with the value instead of using a testing function.) -- If you need to find if a value **exists** in an array, use [`includes()`](./includes.mdx). - Again, it checks each element for equality with the value instead of using a testing function. -- If you need to find if any element satisfies the provided testing function, use [`some()`](./some.mdx). - -## Syntax - -```js -// Arrow function -find((element) => { /* … */ }) -find((element, index) => { /* … */ }) -find((element, index, array) => { /* … */ }) - -// Callback function -find(callbackFn) -find(callbackFn, thisArg) - -// Inline callback function -find(function (element) { /* … */ }) -find(function (element, index) { /* … */ }) -find(function (element, index, array) { /* … */ }) -find(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `find()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The first element in the array that satisfies the provided testing function. -Otherwise, [`undefined`](../../../globals/undefined.mdx) is returned. - -## Description - -The `find()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `find()` then returns that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `find()` returns [`undefined`](../../../globals/undefined.mdx). - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`find()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `find()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `find()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/findIndex.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/findIndex.mdx deleted file mode 100644 index 2601212f4e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/findIndex.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.findIndex - -The **`findIndex()`** method returns the index of the first element in an array that satisfies the provided testing function. -If no elements satisfy the testing function, -1 is returned. - -See also the [`find()`](./find.mdx) method, which returns the first element that satisfies the testing function (rather than its index). - -## Syntax - -```js -// Arrow function -findIndex((element) => { /* … */ }) -findIndex((element, index) => { /* … */ }) -findIndex((element, index, array) => { /* … */ }) - -// Callback function -findIndex(callbackFn) -findIndex(callbackFn, thisArg) - -// Inline callback function -findIndex(function (element) { /* … */ }) -findIndex(function (element, index) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }) -findIndex(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value to indicate a matching element has been found. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `findIndex()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -The index of the first element in the array that passes the test. Otherwise, `-1`. - -## Description - -The `findIndex()` is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order, until `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. `findIndex()` then returns the index of that element and stops iterating through the array. If `callbackFn` never returns a truthy value, `findIndex()` returns `-1`. - -`callbackFn` is invoked for _every_ index of the array, not just those with assigned values. Empty slots in sparse arrays behave the same as `undefined`. - -`findIndex()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `findIndex()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are visited as if they were `undefined`. - -The `findIndex()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/flat.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/flat.mdx deleted file mode 100644 index 22d358b478..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/flat.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flat - -The **`flat()`** method creates a new array with all sub-array -elements concatenated into it recursively up to the specified depth. - -## Syntax - -```js -flat() -flat(depth) -``` - -### Parameters - -- `depth` _**optional**_ - - : The depth level specifying how deep a nested array structure should be flattened. - Defaults to 1. - -### Return value - -A new array with the sub-array elements concatenated into it. - -## Description - -The `flat()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains the same elements as the ones from the original array. - -The `flat()` method ignores empty slots if the array being flattened is sparse. For example, if `depth` is 1, both empty slots in the root array and in the first level of nested arrays are ignored, but empty slots in further nested arrays are preserved with the arrays themselves. - -The `flat()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, its elements must be arrays if they are to be flattened. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/flatMap.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/flatMap.mdx deleted file mode 100644 index e3c1d73392..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/flatMap.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.flatMap() - -The **`flatMap()`** method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a [`Array.prototype.map()`](./map.mdx) followed by a [`Array.prototype.flat()`](./flat.mdx) of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately. - -## Syntax - -```js -// Arrow function -flatMap((element) => { /* … */ }) -flatMap((element, index) => { /* … */ }) -flatMap((element, index, array) => { /* … */ }) - -// Callback function -flatMap(callbackFn) -flatMap(callbackFn, thisArg) - -// Inline callback function -flatMap(function (element) { /* … */ }) -flatMap(function (element, index) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }) -flatMap(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return an array containing new elements of the new array, or a single non-array value to be added to the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `flatMap()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function and flattened -by a depth of 1. - -## Description - -The `flatMap()` method is an iterative method. See [`Array.prototype.map()`](./map.mdx) for a detailed description of the callback function. The `flatMap()` method is identical to [`map(callbackFn, thisArg)`](./map.mdx) followed by [`flat(1)`](./flat.mdx) — for each element, it produces an array of new elements, and concatenates the resulting arrays together to form a new array. - -The `flatMap()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. However, the value returned from `callbackFn` must be an array if it is to be flattened. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/forEach.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/forEach.mdx deleted file mode 100644 index 75adb7d91f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/forEach.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each array element. - -## Syntax - -```js -// Arrow function -forEach((element) => { /* … */ }) -forEach((element, index) => { /* … */ }) -forEach((element, index, array) => { /* … */ }) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function (element) { /* … */ }) -forEach(function (element, index) { /* … */ }) -forEach(function (element, index, array) { /* … */ }) -forEach(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is discarded. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`undefined`. - -## Description - -The `forEach()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array in ascending-index order. Unlike [`Array.prototype.map()`](./map.mdx), `forEach()` always returns [`undefined`](../../../globals/undefined.mdx) and is not chainable. The typical use case is to execute side effects at the end of a chain. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`forEach()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `forEach()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `forEach()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -There is no way to stop or break a `forEach()` loop other than by throwing an exception. If you need such behavior, the `forEach()` method is the wrong tool. - -Early termination may be accomplished with looping statements like [`for`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for), [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of), and [`for...in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...in). Array methods like [`Array.prototype.some()`](./some.mdx), [`Array.prototype.some()`](./some.mdx), [`Array.prototype.find()`](./find.mdx), and [`Array.prototype.findIndex()`](./findIndex.mdx) also stops iteration immediately when further iteration is not necessary. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/includes.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/includes.mdx deleted file mode 100644 index 7ad7a76615..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/includes.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.includes() - -The **`includes()`** method determines whether an array -includes a certain value among its entries, returning `true` or -`false` as appropriate. - -## Syntax - -```js -includes(searchElement) -includes(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : The value to search for. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. However, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `false` is returned. - -### Return value - -A boolean value which is `true` if the value `searchElement` is found within the array (or the part of the array indicated by the index `fromIndex`, if specified). - -## Description - -The `includes()` method compares `searchElement` to elements of the array using the [SameValueZero](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) algorithm. Values of zero are all considered to be equal, regardless of sign. (That is, `-0` is equal to `0`), but `false` is _not_ considered to be the same as `0`. [`NaN`](../../NaN.mdx) can be correctly searched for. - -When used on sparse arrays, the `includes()` method iterates empty slots as if they have the value `undefined`. - -The `includes()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/indexOf.mdx deleted file mode 100644 index fc33ad4974..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/indexOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.indexOf() - -The **`indexOf()`** method returns the first index at which a -given element can be found in the array, or -1 if it is not present. - -## Syntax - -```js -indexOf(searchElement) -indexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. Note, the array is still searched from front to back in this case. - - If `fromIndex < -array.length` or `fromIndex` is omitted, `0` is used, causing the entire array to be searched. - - If `fromIndex >= array.length`, the array is not searched and `-1` is returned. - -### Return value - -The first index of the element in the array; **-1** if not found. - -## Description - -The `indexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `indexOf()` method skips empty slots in sparse arrays. - -The `indexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/join.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/join.mdx deleted file mode 100644 index 84dc12f5f7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/join.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.join() - -The **`join()`** method creates and -returns a new string by concatenating all of the elements in an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)), -separated by commas or a specified separator string. If the array has -only one item, then that item will be returned without using the separator. - -## Syntax - -```js -join() -join(separator) -``` - -### Parameters - -- `separator` _**optional**_ - - : Specifies a string to separate each pair of adjacent elements of the array. The - separator is converted to a string if necessary. If omitted, the array elements are - separated with a comma (","). If `separator` is an empty string, all - elements are joined without any characters in between them. - -### Return value - -A string with all array elements joined. If `arr.length` is -`0`, the empty string is returned. - -## Description - -The string conversions of all array elements are joined into one string. If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -The `join` method is accessed internally by [`Array.prototype.toString()`](./toString.mdx) with no arguments. Overriding `join` of an array instance will override its `toString` behavior as well. - -When used on sparse arrays, the `join()` method iterates empty slots as if they have the value `undefined`. - -The `join()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/keys.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/keys.mdx deleted file mode 100644 index 383d96c2ac..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.keys() - -The **`keys()`** method returns a new **Array -Iterator** object that contains the keys for each index in the array. - -## Syntax - -```js -keys() -``` - -### Return value - -A new `Array` iterator object. - -## Description - -When used on sparse arrays, the `keys()` method iterates empty slots as if they have the value `undefined`. - -The `keys()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/lastIndexOf.mdx deleted file mode 100644 index dc85d2700f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.lastIndexOf() - -The **`lastIndexOf()`** method returns the last index at which -a given element can be found in the array, or -1 if it is not present. The array is -searched backwards, starting at `fromIndex`. - -## Syntax - -```js -lastIndexOf(searchElement) -lastIndexOf(searchElement, fromIndex) -``` - -### Parameters - -- `searchElement` - - : Element to locate in the array. -- `fromIndex` _**optional**_ - - : Zero-based index at which to start searching backwards, converted to an integer. - - Negative index counts back from the end of the array — if `fromIndex < 0`, `fromIndex + array.length` is used. - - If `fromIndex < -array.length`, the array is not searched and `-1` is returned. You can think of it conceptually as starting at a nonexistent position before the beginning of the array and going backwards from there. There are no array elements on the way, so `searchElement` is never found. - - If `fromIndex >= array.length` or `fromIndex` is omitted, `array.length - 1` is used, causing the entire array to be searched. You can think of it conceptually as starting at a nonexistent position beyond the end of the array and going backwards from there. It eventually reaches the real end position of the array, at which point it starts searching backwards through the actual array elements. - -### Return value - -The last index of the element in the array; **-1** if not found. - -## Description - -The `lastIndexOf()` method compares `searchElement` to elements of the array using [strict equality](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) (the same algorithm used by the `===` operator). - -The `lastIndexOf()` method skips empty slots in sparse arrays. - -The `lastIndexOf()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/length.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/length.mdx deleted file mode 100644 index b6e08db845..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/length.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.length - -The **`length`** data property of an `Array` instance represents the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. - -## Value - -A non-negative integer less than 232. - -## Description - -The value of the `length` property is a non-negative integer with a value less than 232. - -```js -const listA = [1, 2, 3]; -const listB = new Array(6); - -console.log(listA.length); -// 3 - -console.log(listB.length); -// 6 - -listB.length = 2 ** 32; // 4294967296 -// RangeError: Invalid array length - -const listC = new Array(-100); // Negative numbers are not allowed -// RangeError: Invalid array length -``` - -The array object observes the `length` property, and automatically syncs the `length` value with the array's content. This means: - -- Setting `length` to a value smaller than the current length truncates the array — elements beyond the new `length` are deleted. -- Setting any array index (a non-negative integer smaller than 232) beyond the current `length` extends the array — the `length` property is increased to reflect the new highest index. -- Setting `length` to an invalid value (e.g. a negative number or a non-integer) throws a `RangeError` exception. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/map.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/map.mdx deleted file mode 100644 index 078d3fd24e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/map.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.map() - -The **`map()`** method **creates -a new array** populated with the results of calling a provided function on -every element in the calling array. - -## Syntax - -```js -// Arrow function -map((element) => { /* … */ }) -map((element, index) => { /* … */ }) -map((element, index, array) => { /* … */ }) - -// Callback function -map(callbackFn) -map(callbackFn, thisArg) - -// Inline callback function -map(function (element) { /* … */ }) -map(function (element, index) { /* … */ }) -map(function (element, index, array) { /* … */ }) -map(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value is added as a single element in the new array. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `map()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -A new array with each element being the result of the callback function. - -## Description - -The `map()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array and constructs a new array from the results. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -The `map()` method is a copying method. It does not alter `this`. However, the function provided as `callbackFn` can mutate the array. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `map()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `map()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -Since `map` builds a new array, calling it without using the returned -array is an anti-pattern; use [`Array.prototype.forEach()`](./forEach.mdx) or -`for...of` instead. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/pop.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/pop.mdx deleted file mode 100644 index 5ceeb3967f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/pop.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.pop() - -The **`pop()`** method removes the **last** -element from an array and returns that element. This method changes the length of the -array. - -## Syntax - -```js -pop() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `pop()` method removes the last element from an array and returns that value to the caller. If you call `pop()` on an empty array, it returns [`undefined`](../../../globals/undefined.mdx). - -[`Array.prototype.shift()`](./shift.mdx) has similar behavior to `pop()`, but applied to the first element in an array. - -The `pop()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the last element removed, you can use [`arr.slice(0, -1)`](./slice.mdx) instead. - -The `pop()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/push.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/push.mdx deleted file mode 100644 index 40a1de8d11..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/push.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.push() - -The **`push()`** method adds one or more elements to the end of -an array and returns the new length of the array. - -## Syntax - -```js -push(element0) -push(element0, element1) -push(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The element(s) to add to the end of the array. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the method was called. - -## Description - -The `push()` method appends values to an array. - -[`Array.prototype.unshift()`](./unshift.mdx)has similar behavior to `push()`, but applied to the start of an array. - -The `push()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with elements appended to the end, you can use [`arr.concat([element0, element1, /* ... ,*/ elementN])`](./concat.mdx) instead. Notice that the elements are wrapped in an extra array — otherwise, if the element is an array itself, it would be spread instead of pushed as a single element due to the behavior of `concat()`. - -The `push()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/reduce.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/reduce.mdx deleted file mode 100644 index a26246ac6a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/reduce.mdx +++ /dev/null @@ -1,125 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduce() - -The **`reduce()`** method executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. -The final result of running the reducer across all elements of the array is a single value. - -The first time that the callback is run there is no "return value of the previous calculation". -If supplied, an initial value may be used in its place. -Otherwise the array element at index 0 is used as the initial value and iteration starts from the next element (index 1 instead of index 0). - -Perhaps the easiest-to-understand case for `reduce()` is to return the sum of all the elements in an array: - -The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this result is the running sum of all the previous steps) — until there are no more elements to add. - -## Syntax - -```js -// Arrow function -reduce((accumulator, currentValue) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }) - -reduce((accumulator, currentValue) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex) => { /* … */ }, initialValue) -reduce((accumulator, currentValue, currentIndex, array) => { /* … */ }, initialValue) - -// Callback function -reduce(callbackFn) -reduce(callbackFn, initialValue) - -// Inline callback function -reduce(function (accumulator, currentValue) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }) - -reduce(function (accumulator, currentValue) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex) { /* … */ }, initialValue) -reduce(function (accumulator, currentValue, currentIndex, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value resulting from the previous call to `callbackFn`. On first call, `initialValue` if specified, otherwise the value of `array[0]`. - - `currentValue` - - : The value of the current element. On first call, the value of `array[0]` if an `initialValue` was specified, otherwise the value of `array[1]`. - - `currentIndex` - - : The index position of `currentValue` in the array. On first call, `0` if `initialValue` was specified, otherwise `1`. - - `array` - - : The array `reduce()` was called upon. - -- `initialValue` _**optional**_ - - : A value to which `accumulator` is initialized the first time the callback is called. - If `initialValue` is specified, `callbackFn` starts executing with the first value in the array as `currentValue`. - If `initialValue` is _not_ specified, `accumulator` is initialized to the first value in the array, and `callbackFn` starts executing with the second value in the array as `currentValue`. In this case, if the array is empty (so that there's no first value to return as `accumulator`), an error is thrown. - -### Return value - -The value that results from running the "reducer" callback function to completion over the entire array. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - - : The array contains no elements and `initialValue` is not provided. - -## Description - -The `reduce()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in ascending-index order, and accumulates them into a single value. Every time, the return value of `callbackFn` is passed into `callbackFn` again on next invocation as `accumulator`. The final value of `accumulator` (which is the value returned from `callbackFn` on the final iteration of the array) becomes the return value of `reduce()`. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduce()` is a central concept in [functional programming](https://en.wikipedia.org/wiki/Functional_programming), where it's not possible to mutate any value, so in order to accumulate all values in an array, one must return a new accumulator value on every iteration. This convention propagates to JavaScript's `reduce()`: you should use [spreading](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) or other copying methods where possible to create new arrays and objects as the accumulator, rather than mutating the existing one. If you decided to mutate the accumulator instead of copying it, remember to still return the modified object in the callback, or the next iteration will receive undefined. - -`reduce()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduce()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduce()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. - -### When to not use reduce() - -Recursive functions like `reduce()` can be powerful but sometimes difficult to understand, especially for less-experienced JavaScript developers. If code becomes clearer when using other array methods, developers must weigh the readability tradeoff against the other benefits of using `reduce()`. In cases where `reduce()` is the best choice, documentation and semantic variable naming can help mitigate readability drawbacks. - -### Edge cases - -If the array only has one element (regardless of position) and no `initialValue` is provided, or if `initialValue` is provided but the array is empty, the solo value will be returned _without_ calling `callbackFn`. - -If `initialValue` is provided and the array is not empty, then the reduce method will always invoke the callback function starting at index 0. - -If `initialValue` is not provided then the reduce method will act differently for arrays with length larger than 1, equal to 1 and 0, as shown in the following example: - -```js -const getMax = (a, b) => Math.max(a, b); - -// callback is invoked for each element in the array starting at index 0 -[1, 100].reduce(getMax, 50); // 100 -[50].reduce(getMax, 10); // 50 - -// callback is invoked once for element at index 1 -[1, 100].reduce(getMax); // 100 - -// callback is not invoked -[50].reduce(getMax); // 50 -[].reduce(getMax, 1); // 1 - -[].reduce(getMax); // TypeError -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/reduceRight.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/reduceRight.mdx deleted file mode 100644 index 6c3f91cc44..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/reduceRight.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reduceRight() - -The **`reduceRight()`** method applies a function against an -accumulator and each value of the array (from right-to-left) to reduce it to a single -value. - -See also [`Array.prototype.reduce()`](./reduce.mdx) for left-to-right. - -## Syntax - -```js -// Arrow function -reduceRight((accumulator, currentValue) => { /* … */ }) -reduceRight((accumulator, currentValue, index) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }) -reduceRight((accumulator, currentValue, index, array) => { /* … */ }, initialValue) - -// Callback function -reduceRight(callbackFn) -reduceRight(callbackFn, initialValue) - -// Callback reducer function -reduceRight(function (accumulator, currentValue) { /* … */ }) -reduceRight(function (accumulator, currentValue, index) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }) -reduceRight(function (accumulator, currentValue, index, array) { /* … */ }, initialValue) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. Its return value becomes the value of the `accumulator` parameter on the next invocation of `callbackFn`. For the last invocation, the return value becomes the return value of `reduce()`. - - The function is called with the following arguments: - - - `accumulator` - - : The value previously returned in the last invocation of the callback, or - `initialValue`, if supplied. (See below.) - - `currentValue` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `reduceRight()` was called upon. - -- `initialValue` _**optional**_ - - : Value to use as accumulator to the first call of the - `callbackFn`. If no initial value is supplied, the last element in - the array will be used and skipped. Calling reduce or reduceRight on an empty array - without an initial value creates a `TypeError`. - -### Return value - -The value that results from the reduction. - -## Description - -The `reduceRight()` method is an iterative method. It runs a "reducer" callback function over all elements in the array, in descending-index order, and accumulates them into a single value. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -Unlike other [iterative methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods), `reduce()` does not accept a `thisArg` argument. `callbackFn` is always called with `undefined` as `this`, which gets substituted with `globalThis` if `callbackFn` is non-strict. - -`reduceRight()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `reduceRight()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - - - -The `reduceRight()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/reverse.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/reverse.mdx deleted file mode 100644 index c08bc646f8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/reverse.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.reverse() - -The **`reverse()`** method reverses an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, the first array element now becoming the last, and the last array element becoming the first. In other words, elements order in the array will be turned towards the direction opposite to that previously stated. - -## Syntax - -```js -reverse() -``` - -### Return value - -The reference to the original array, now reversed. Note that the array is reversed _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -The `reverse()` method transposes the elements of the calling array object in -place, mutating the array, and returning a reference to the array. - -The `reverse()` method preserves empty slots. If the source array is sparse, the empty slots' corresponding new indices are [deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) and also become empty slots. - -The `reverse()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/shift.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/shift.mdx deleted file mode 100644 index 80b25508e8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/shift.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.shift() - -The **`shift()`** method removes the **first** -element from an array and returns that removed element. This method changes the length -of the array. - -## Syntax - -```js -shift() -``` - -### Return value - -The removed element from the array; [`undefined`](../../../globals/undefined.mdx) if the array is empty. - -## Description - -The `shift()` method removes the element at the zeroth index and shifts the -values at consecutive indexes down, then returns the removed value. If the -[`Array.prototype.length`](./length.mdx) property is 0, [`undefined`](../../../globals/undefined.mdx) is returned. - -The [`Array.prototype.pop()`](./pop.mdx) method has similar behavior to `shift()`, but applied to the last element in an array. - -The `shift()` method is a mutating method. It changes the length and the content of `this`. In case you want the value of `this` to be the same, but return a new array with the first element removed, you can use [`arr.slice(1)`](./slice.mdx) instead. - -The `shift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/slice.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/slice.mdx deleted file mode 100644 index 322752189a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/slice.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.slice() - -The **`slice()`** method returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) of a portion of -an array into a new array object selected from `start` to `end` -(`end` not included) where `start` and `end` represent -the index of items in that array. The original array will not be modified. - -## Syntax - -```js -slice() -slice(start) -slice(start, end) -``` - -### Parameters - -- `start` _**optional**_ - - : Zero-based index at which to start extraction, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, nothing is extracted. -- `end` _**optional**_ - - : Zero-based index at which to end extraction, converted to an integer. `slice()` extracts up to but not including `end`. - - Negative index counts back from the end of the array — if `end < 0`, `end + array.length` is used. - - If `end < -array.length`, `0` is used. - - If `end >= array.length` or `end` is omitted, `array.length` is used, causing all elements until the end to be extracted. - - If `end` is positioned before or at `start` after normalization, nothing is extracted. - -### Return value - -A new array containing the extracted elements. - -## Description - -The `slice()` method is a copying method. It does not alter `this` but instead returns a [shallow copy](https://developer.mozilla.org/docs/Glossary/Shallow_copy) that contains some of the same elements as the ones from the original array. - -The `slice()` method preserves empty slots. If the sliced portion is sparse, the returned array is sparse as well. - -The `slice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/some.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/some.mdx deleted file mode 100644 index 81e0c614cc..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/some.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.some() - -The **`some()`** method tests whether -at least one element in the array passes the test implemented by the provided -function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array. - -## Syntax - -```js -// Arrow function -some((element) => { /* … */ }) -some((element, index) => { /* … */ }) -some((element, index, array) => { /* … */ }) - -// Callback function -some(callbackFn) -some(callbackFn, thisArg) - -// Inline callback function -some(function (element) { /* … */ }) -some(function (element, index) { /* … */ }) -some(function (element, index, array) { /* … */ }) -some(function (element, index, array) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - - : A function to execute for each element in the array. It should return a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) to indicate the element passes the test, and a falsy value otherwise. - - The function is called with the following arguments: - - - `element` - - : The current element being processed in the array. - - `index` - - : The index of the current element being processed in the array. - - `array` - - : The array `some()` was called upon. - -- `thisArg` _**optional**_ - - : A value to use as `this` when executing `callbackFn`. - -### Return value - -`true` if the callback function returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value for at least one element in the array. Otherwise, `false`. - -## Description - -The `some()` method is an iterative method. It calls a provided `callbackFn` function once for each element in an array, until the `callbackFn` returns a [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value. If such an element is found, `some()` immediately returns `true` and stops iterating through the array. Otherwise, if `callbackFn` returns a [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value for all elements, `some()` returns `false`. - -`some()` acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns `false` for any condition. - -`callbackFn` is invoked only for array indexes which have assigned values. It is not invoked for empty slots in sparse arrays. - -`some()` does not mutate the array on which it is called, but the function provided as `callbackFn` can. Note, however, that the length of the array is saved _before_ the first invocation of `callbackFn`. Therefore: - -- `callbackFn` will not visit any elements added beyond the array's initial length when the call to `some()` began. -- Changes to already-visited indexes do not cause `callbackFn` to be invoked on them again. -- If an existing, yet-unvisited element of the array is changed by `callbackFn`, its value passed to the `callbackFn` will be the value at the time that element gets visited. [Deleted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) elements are not visited. - -The `some()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/sort.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/sort.mdx deleted file mode 100644 index 6307c151db..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/sort.mdx +++ /dev/null @@ -1,110 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.sort() - -The **`sort()`** method sorts the elements of an array _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_ and returns the reference to the same array, now sorted. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. - -The time and space complexity of the sort cannot be guaranteed as it depends on the -implementation. - -## Syntax - -```js -// Functionless -sort() - -// Arrow function -sort((a, b) => { /* … */ } ) - -// Compare function -sort(compareFn) - -// Inline compare function -sort(function compareFn(a, b) { /* … */ }) -``` - -### Parameters - -- `compareFn` _**optional**_ - - - : Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - - - `a` - - : The first element for comparison. - - `b` - - : The second element for comparison. - -### Return value - -The reference to the original array, now sorted. Note that the array is sorted _[in place](https://en.wikipedia.org/wiki/In-place_algorithm)_, and no copy is made. - -## Description - -If `compareFn` is not supplied, all non-`undefined` array -elements are sorted by converting them to strings and comparing strings in UTF-16 code -units order. For example, "banana" comes before "cherry". In a numeric sort, 9 comes -before 80, but because numbers are converted to strings, "80" comes before "9" in the -Unicode order. All `undefined` elements are sorted to the end of the array. - -The `sort()` method preserves empty slots. If the source array is sparse, the empty slots are moved to the end of the array, and always come after all the `undefined`. - -> **Note:** In UTF-16, Unicode characters above `\uFFFF` are -> encoded as two surrogate code units, of the range -> `\uD800` - `\uDFFF`. The value of each code unit is taken -> separately into account for the comparison. Thus the character formed by the surrogate -> pair `\uD855\uDE51` will be sorted before the character -> `\uFF3A`. - -If `compareFn` is supplied, all non-`undefined` array -elements are sorted according to the return value of the compare function (all -`undefined` elements are sorted to the end of the array, with no call to -`compareFn`). - -| `compareFn(a, b)` return value | sort order | -| ------------------------------ | ---------------------------------- | -| > 0 | sort `a` after `b` | -| < 0 | sort `a` before `b` | -| === 0 | keep original order of `a` and `b` | - -So, the compare function has the following form: - -```js -function compareFn(a, b) { - if (a is less than b by some ordering criterion) { - return -1; - } - if (a is greater than b by the ordering criterion) { - return 1; - } - // a must be equal to b - return 0; -} -``` - -More formally, the comparator is expected to have the following properties, in order to ensure proper sort behavior: - -- _Pure_: The comparator does not mutate the objects being compared or any external state. (This is important because there's no guarantee _when_ and _how_ the comparator will be called, so any particular call should not produce visible effects to the outside.) -- _Stable_: The comparator returns the same result with the same pair of input. -- _Reflexive_: `compareFn(a, a) === 0`. -- _Anti-symmetric_: `compareFn(a, b)` and `compareFn(b, a)` must both be `0` or have opposite signs. -- _Transitive_: If `compareFn(a, b)` and `compareFn(b, c)` are both positive, zero, or negative, then `compareFn(a, c)` has the same positivity as the previous two. - -A comparator conforming to the constraints above will always be able to return all of `1`, `0`, and `-1`, or consistently return `0`. For example, if a comparator only returns `1` and `0`, or only returns `0` and `-1`, it will not be able to sort reliably because _anti-symmetry_ is broken. A comparator that always returns `0` will cause the array to not be changed at all, but is reliable nonetheless. - -The default lexicographic comparator satisfies all constraints above. - -To compare numbers instead of strings, the compare function can subtract `b` -from `a`. The following function will sort the array in ascending order (if -it doesn't contain `Infinity` and `NaN`): - -```js -function compareNumbers(a, b) { - return a - b; -} -``` - -The `sort()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/splice.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/splice.mdx deleted file mode 100644 index 22d3033e5e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/splice.mdx +++ /dev/null @@ -1,59 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.splice() - -The **`splice()`** method changes the contents of an array by -removing or replacing existing elements and/or adding new elements [in place](https://en.wikipedia.org/wiki/In-place_algorithm). To access part of an array without modifying it, see [`Array.prototype.slice()`](./slice.mdx). - -## Syntax - -```js -splice(start) -splice(start, deleteCount) -splice(start, deleteCount, item1) -splice(start, deleteCount, item1, item2, itemN) -``` - -### Parameters - -- `start` - - - : Zero-based index at which to start changing the array, converted to an integer. - - Negative index counts back from the end of the array — if `start < 0`, `start + array.length` is used. - - If `start < -array.length` or `start` is omitted, `0` is used. - - If `start >= array.length`, no element will be deleted, but the method will behave as an adding function, adding as many elements as provided. - -- `deleteCount` _**optional**_ - - - : An integer indicating the number of elements in the array to remove from `start`. - - If `deleteCount` is omitted, or if its value is greater than or equal to the number of elements after the position specified by `start`, then all the elements from `start` to the end of the array will be deleted. However, if you wish to pass any `itemN` parameter, you should pass `Infinity` as `deleteCount` to delete all elements after `start`, because an explicit `undefined` gets [converted](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#integer_conversion) to `0`. - - If `deleteCount` is `0` or negative, no elements are removed. - In this case, you should specify at least one new element (see below). - -- `item1`, …, `itemN` _**optional**_ - - - : The elements to add to the array, beginning from `start`. - - If you do not specify any elements, `splice()` will only remove elements from the array. - -### Return value - -An array containing the deleted elements. - -If only one element is removed, an array of one element is returned. - -If no elements are removed, an empty array is returned. - -## Description - -The `splice()` method is a mutating method. It may change the content of `this`. If the specified number of elements to insert differs from the number of elements being removed, the array's `length` will be changed as well. At the same time, it uses [`@@species`](../@@species.mdx) to create a new array instance to be returned. - -If the deleted portion is sparse, the array returned by `splice()` is sparse as well, with those corresponding indices being empty slots. - -The `splice()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/toLocaleString.mdx deleted file mode 100644 index 1451a99636..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/toLocaleString.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing -the elements of the array. The elements are converted to Strings using their -`toLocaleString` methods and these Strings are separated by a locale-specific -String (such as a comma ","). - - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). -- `options` _**optional**_ - - : An object with configuration properties. For numbers, see [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx); for dates, see [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array.prototype.toLocaleString` method traverses its content, calling the `toLocaleString` method of every element with the `locales` and `options` parameters provided, and concatenates them with an implementation-defined separator (such as a comma ","). Note that the method itself does not consume the two parameters — it only passes them to the `toLocaleString()` of each element. The choice of the separator string depends on the host's current locale, not the `locales` parameter. - -If an element is `undefined`, `null`, it is converted to an empty string instead of the string `"null"` or `"undefined"`. - -When used on sparse arrays, the `toLocaleString()` method iterates empty slots as if they have the value `undefined`. - -The `toLocaleString()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/toString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/toString.mdx deleted file mode 100644 index 459b05b3f7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/toString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.toString() - -The **`toString()`** method returns a string representing the -specified array and its elements. - - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the elements of the array. - -## Description - -The `Array` object overrides the `toString` method of `Object`. The `toString` method of arrays calls [`join()`](../../../globals/Array/prototype/join.mdx) internally, which joins the array and returns one string containing each array element separated by commas. If the `join` method is unavailable or is not a function, [`Object.prototype.toString`](../../../globals/Object/prototype/toString.mdx) is used instead, returning `[object Array]`. - -```js -const arr = []; -arr.join = 1; // re-assign `join` with a non-function -console.log(arr.toString()); // [object Array] - -console.log(Array.prototype.toString.call({ join: () => 1 })); // 1 -``` - -JavaScript calls the `toString` method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/unshift.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/unshift.mdx deleted file mode 100644 index e1c7167b2a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/unshift.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.unshift() - -The **`unshift()`** method adds one or more elements to the -beginning of an array and returns the new length of the array. - -## Syntax - -```js -unshift(element0) -unshift(element0, element1) -unshift(element0, element1, /* … ,*/ elementN) -``` - -### Parameters - -- `elementN` - - : The elements to add to the front of the `arr`. - -### Return value - -The new [`Array.prototype.length`](./length.mdx) property of the object upon which the -method was called. - -## Description - -The `unshift()` method inserts the given values to the beginning of an -array-like object. - -[`Array.prototype.push()`](./push.mdx) has similar behavior to `unshift()`, but applied to the end of an array. - -Please note that, if multiple elements are passed as parameters, they're inserted in -chunk at the beginning of the object, in the exact same order they were passed as -parameters. Hence, calling `unshift()` with `n` -arguments **once**, or calling it `n` times with -**1** argument (with a loop, for example), don't yield the same results. - -See example: - -```js -let arr = [4, 5, 6]; - -arr.unshift(1, 2, 3); -console.log(arr); -// [1, 2, 3, 4, 5, 6] - -arr = [4, 5, 6]; // resetting the array - -arr.unshift(1); -arr.unshift(2); -arr.unshift(3); - -console.log(arr); -// [3, 2, 1, 4, 5, 6] -``` - -The `unshift()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. Although strings are also array-like, this method is not suitable to be applied on them, as strings are immutable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/values.mdx b/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/values.mdx deleted file mode 100644 index 6d8511a98c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Array/prototype/values.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Array.prototype.values() - -The **`values()`** method returns a new _array [iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol)_ object that iterates the value of each index in the array. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterable iterator object. - -## Description - -`Array.prototype.values()` is the default implementation of [`Array.prototype[@@iterator]()`](./@@iterator.mdx). - -```js -Array.prototype.values === Array.prototype[Symbol.iterator]; // true -``` - -When used on sparse arrays, the `values()` method iterates empty slots as if they have the value `undefined`. - -The `values()` method is generic. It only expects the `this` value to have a `length` property and integer-keyed properties. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/@@species.mdx b/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/@@species.mdx deleted file mode 100644 index ad6d14f1dd..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get ArrayBuffer\[Symbol.species] - -The **`ArrayBuffer[Symbol.species]`** accessor property returns the constructor used to construct return values from array buffer methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -ArrayBuffer[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from array buffer methods that create new array buffers. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class ArrayBuffer { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubArrayBuffer extends ArrayBuffer {} -SubArrayBuffer[Symbol.species] === SubArrayBuffer; // true -``` - -When calling array buffer methods that do not mutate the existing object but return a new array buffer instance (for example, [`slice()`](./prototype/slice.mdx)), the object's `constructor[Symbol.species]` will be accessed. The returned constructor will be used to construct the return value of the array buffer method. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/ArrayBuffer.mdx b/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/ArrayBuffer.mdx deleted file mode 100644 index 42bf9d83a2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/ArrayBuffer.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer() - -The **`ArrayBuffer()`** constructor is used to create "ArrayBuffer" objects. - -## Syntax - -```js -new ArrayBuffer(length) -``` - -> **Note:** `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `length` - - : The size, in bytes, of the array buffer to create. - -### Return value - -A new `ArrayBuffer` object of the specified size. Its contents are -initialized to 0. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - : Thrown if the `length` is larger than `Number_MAX_SAFE_INTEGER` (≥ 253) or negative. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/isView.mdx b/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/isView.mdx deleted file mode 100644 index 1f99acd180..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/isView.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.isView - -The **`ArrayBuffer.isView()`** method determines whether the -passed value is one of the `ArrayBuffer` views, -such as [typed array objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) -or a [`DataView`](../DataView/DataView.mdx). - -## Syntax - -```js -ArrayBuffer.isView(value) -``` - -### Parameters - -- `value` - - : The value to be checked. - -### Return value - -`true` if the given argument is one of the `ArrayBuffer` views; -otherwise, `false`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/prototype/byteLength.mdx deleted file mode 100644 index d0cecd6ac6..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.byteLength - -The **`byteLength`** accessor property represents the length of an `ArrayBuffer` in bytes. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this `ArrayBuffer` has been detached. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/prototype/slice.mdx b/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/prototype/slice.mdx deleted file mode 100644 index ef6bc7d960..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ArrayBuffer/prototype/slice.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ArrayBuffer.prototype.slice() - -The **`slice()`** method returns a new `ArrayBuffer` -whose contents are a copy of this `ArrayBuffer`'s bytes from -`begin`, inclusive, up to `end`, exclusive. - -## Syntax - -```js -slice(begin) -slice(begin, end) -``` - -### Parameters - -- `begin` - - : Zero-based byte index at which to begin slicing. -- `end` _**optional**_ - - : Byte index before which to end slicing. If end is unspecified, the new - `ArrayBuffer` contains all bytes from begin to the end of this - `ArrayBuffer`. If negative, it will make the Byte index begin from the last - Byte. - -### Return value - -A new `ArrayBuffer` object. - -## Description - -The `slice()` method copies up to, but not including, the byte indicated by -the `end` parameter. If either `begin` or `end` is -negative, it refers to an index from the end of the array, as opposed to from the -beginning. - -The range specified by the `begin` and `end` parameters is -clamped to the valid index range for the current array. If the computed length of the -new `ArrayBuffer` would be negative, it is clamped to zero. diff --git a/documentation/versioned_docs/version-3.9.0/globals/BigInt/BigInt.mdx b/documentation/versioned_docs/version-3.9.0/globals/BigInt/BigInt.mdx deleted file mode 100644 index 79dcdc712e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/BigInt/BigInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt() - -The **`BigInt()`** function returns a value of type **bigint**. - -## Syntax - -```js -BigInt(value) -``` - -> **Note:** `BigInt()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `value` - - : The numeric value of the object being created. It may be a string, an integer, a boolean, or another `BigInt`. - -### Return value - -A `BigInt` value. Number values must be integers and are converted to BigInts. The boolean value `true` becomes `1n`, and `false` becomes `0n`. Strings are parsed as if they are source text for integer literals, which means they can have leading and trailing whitespaces and can be prefixed with `0b`, `0o`, or `0x`. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if the parameter is a non-integral number. -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if at least one of these conditions is met: - - The parameter cannot be converted to a primitive. - - After conversion to a primitive, the result is [`undefined`](../undefined.mdx), `null`, `Symbol`. -- [`SyntaxError`](../SyntaxError/SyntaxError.mdx) - - : Thrown if the parameter is a string that cannot be parsed as a `BigInt`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/BigInt/asIntN.mdx b/documentation/versioned_docs/version-3.9.0/globals/BigInt/asIntN.mdx deleted file mode 100644 index 501db735dd..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/BigInt/asIntN.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asIntN() - -The **`BigInt.asIntN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as a signed integer. - -## Syntax - -```js -BigInt.asIntN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as a signed integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asIntN` method clamps a `BigInt` value to the given number of bits, and interprets the result as a signed integer. For example, for `BigInt.asIntN(3, 25n)`, the value `25n` is clamped to `1n`: - -```plain -25n = 00011001 (base 2) - ^=== Clamp to three remaining bits -===> 001 (base 2) = 1n -``` - -If the leading bit of the remaining number is `1`, the result is negative. For example, `BigInt.asIntN(4, 25n)` yields `-7n`, because `1001` is the encoding of `-7` under two's complement: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = -7n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asIntN` is a static property of `BigInt`, so you always use it as `BigInt.asIntN()`, rather than as a method of a BigInt value. Exposing `asIntN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.9.0/globals/BigInt/asUintN.mdx b/documentation/versioned_docs/version-3.9.0/globals/BigInt/asUintN.mdx deleted file mode 100644 index e3dd55ec0e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/BigInt/asUintN.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.asUintN() - -The **`BigInt.asUintN`** static method clamps a `BigInt` value to the given number of bits, and returns that value as an unsigned integer. - -## Syntax - -```js -BigInt.asUintN(bits, bigint) -``` - -### Parameters - -- `bits` - - : The amount of bits available for the returned BigInt. Should be an integer between 0 and 253 - 1, inclusive. -- `bigint` - - : The BigInt value to clamp to fit into the supplied bits. - -### Return value - -The value of `bigint` modulo 2^`bits`, as an unsigned integer. - -### Exceptions - -- [`RangeError`](../../globals/RangeError/RangeError.mdx) - - : Thrown if `bits` is negative or greater than 253 - 1. - -## Description - -The `BigInt.asUintN` method clamps a `BigInt` value to the given number of bits, and interprets the result as an unsigned integer. Unsigned integers have no sign bits and are always non-negative. For example, for `BigInt.asUintN(4, 25n)`, the value `25n` is clamped to `9n`: - -```plain -25n = 00011001 (base 2) - ^==== Clamp to four remaining bits -===> 1001 (base 2) = 9n -``` - -> **Note:** `BigInt` values are always encoded as two's complement in binary. - -Unlike similar language APIs such as [`Number.prototype.toExponential()`](../Number/prototype/toExponential.mdx), `asUintN` is a static property of `BigInt`, so you always use it as `BigInt.asUintN()`, rather than as a method of a BigInt value. Exposing `asUintN()` as a "standard library function" allows [interop with asm.js](https://github.com/tc39/proposal-bigint/blob/master/ADVANCED.md#dont-break-asmjs). diff --git a/documentation/versioned_docs/version-3.9.0/globals/BigInt/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.9.0/globals/BigInt/prototype/toLocaleString.mdx deleted file mode 100644 index 5fe60059b0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/BigInt/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this BigInt. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given BigInt. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format()` method. diff --git a/documentation/versioned_docs/version-3.9.0/globals/BigInt/prototype/toString.mdx b/documentation/versioned_docs/version-3.9.0/globals/BigInt/prototype/toString.mdx deleted file mode 100644 index ca8dec3f10..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/BigInt/prototype/toString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.toString() - -The **`toString()`** method returns a string representing the specified `BigInt` value. The trailing "n" is not part of the string. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range 2 through 36 specifying the base to use for representing the BigInt value. Defaults to 10. - -### Return value - -A string representing the specified `BigInt` value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `BigInt` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `BigInt` values, the `toString()` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified BigInt value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the BigInt value preceded by a `-` sign, **not** the two's complement of the BigInt value. - -The `toString()` method requires its `this` value to be a `BigInt` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to BigInt values. - -Because `BigInt` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `BigInt` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, BigInt _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -BigInt.prototype.toString = () => "Overridden"; -console.log(`${1n}`); // "1" -console.log(`${Object(1n)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/BigInt/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/BigInt/prototype/valueOf.mdx deleted file mode 100644 index 948a49f04d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/BigInt/prototype/valueOf.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `BigInt` object. - -## Syntax - -```js -bigIntObj.valueOf() -``` - -### Return value - -A BigInt representing the primitive value of the specified `BigInt` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/BigInt64Array/BigInt64Array.mdx b/documentation/versioned_docs/version-3.9.0/globals/BigInt64Array/BigInt64Array.mdx deleted file mode 100644 index 9ffaffe74b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/BigInt64Array/BigInt64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigInt64Array() - -The **`BigInt64Array()`** typed array constructor creates a -new `BigInt64Array` object, which is, an array of 64-bit signed integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigInt64Array() -new BigInt64Array(length) -new BigInt64Array(typedArray) -new BigInt64Array(object) - -new BigInt64Array(buffer) -new BigInt64Array(buffer, byteOffset) -new BigInt64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigInt64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.9.0/globals/BigUint64Array/BigUint64Array.mdx b/documentation/versioned_docs/version-3.9.0/globals/BigUint64Array/BigUint64Array.mdx deleted file mode 100644 index 3a5342647b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/BigUint64Array/BigUint64Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# BigUint64Array() - -The **`BigUint64Array()`** typed array constructor creates a -new `BigUint64Array` object, which is, an array of 64-bit unsigned integers -in the platform byte order. If control over byte order is needed, use -[`DataView`](../DataView/DataView.mdx) instead. The contents are initialized to `0n`. Once -established, you can reference elements in the array using the object's methods, or by -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new BigUint64Array() -new BigUint64Array(length) -new BigUint64Array(typedArray) -new BigUint64Array(object) - -new BigUint64Array(buffer) -new BigUint64Array(buffer, byteOffset) -new BigUint64Array(buffer, byteOffset, length) -``` - -> **Note:** `BigUint64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](..//TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Boolean/Boolean.mdx b/documentation/versioned_docs/version-3.9.0/globals/Boolean/Boolean.mdx deleted file mode 100644 index e10afd7266..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Boolean/Boolean.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean() - -The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean. - -## Syntax - -```js -new Boolean(value) -Boolean(value) -``` - -> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The initial value of the `Boolean` object. - -### Return value - -When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive. - -When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive. - -> **Warning:** You should rarely find yourself using `Boolean` as a constructor. - -## Description - -The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), or the empty string (`""`), then the object has an initial value of `false`. All other values, including any object, an empty array (`[]`), or the string `"false"`, create an object with an initial value of `true`. - -> **Note:** When the non-standard property [`document.all`](https://developer.mozilla.org/docs/Web/API/Document/all) is used as an argument for this constructor, the result is a `Boolean` object with the value `false`. This property is legacy and non-standard and should not be used. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Boolean/prototype/toString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Boolean/prototype/toString.mdx deleted file mode 100644 index 4df09cfa65..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Boolean/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.toString() - -The **`toString()`** method returns a string representing the specified boolean value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified boolean value. - -## Description - -The `Boolean` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`. - -The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values. - -Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Boolean.prototype.toString = () => "Overridden"; -console.log(`${true}`); // "true" -console.log(`${new Boolean(true)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/Boolean/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Boolean/prototype/valueOf.mdx deleted file mode 100644 index fa73f672c7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Boolean/prototype/valueOf.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Boolean.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Boolean` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the given `Boolean` object. - -## Description - -The `valueOf()` method of `Boolean` returns the primitive value -of a `Boolean` object or literal `Boolean` as a Boolean data type. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx b/documentation/versioned_docs/version-3.9.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx deleted file mode 100644 index 6e2b34a138..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy() - -The **`ByteLengthQueuingStrategy()`** -constructor creates and returns a `ByteLengthQueuingStrategy` object -instance. - -## Syntax - -```js -new ByteLengthQueuingStrategy(highWaterMark) -``` - -### Parameters - -An object with the following property: - -- `highWaterMark` - - - : The total number of bytes that can be contained in the internal queue before backpressure is applied. - - Unlike `CountQueuingStrategy()` where the `highWaterMark` parameter specifies a simple count of the number of chunks, with `ByteLengthQueuingStrategy()`, the `highWaterMark` parameter specifies a number of _bytes_ — specifically, given a stream of chunks, how many bytes worth of those chunks (rather than a count of how many of those chunks) can be contained in the internal queue before backpressure is applied. - -### Return value - -An instance of the `ByteLengthQueuingStrategy` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx b/documentation/versioned_docs/version-3.9.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx deleted file mode 100644 index 17b0a1dce2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ByteLengthQueuingStrategy/prototype/size.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ByteLengthQueuingStrategy.size() - -The **`size()`** method of the -`ByteLengthQueuingStrategy` interface returns the given chunk's -`byteLength` property. - -## Syntax - -```js -size(chunk) -``` - -### Parameters - -- `chunk` - - : A chunk of data being passed through the stream. - -### Return value - -An integer representing the byte length of the given chunk. diff --git a/documentation/versioned_docs/version-3.9.0/globals/CompressionStream/CompressionStream.mdx b/documentation/versioned_docs/version-3.9.0/globals/CompressionStream/CompressionStream.mdx deleted file mode 100644 index a5594a88c5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/CompressionStream/CompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream() - -The **`CompressionStream()`** constructor creates a new `CompressionStream` object which compresses a stream of data. - -## Syntax - -```js -new CompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following allowed compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.9.0/globals/CompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.9.0/globals/CompressionStream/prototype/readable.mdx deleted file mode 100644 index 27a2f8900b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/CompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.readable - -The **`readable`** read-only property of the `CompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/CompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.9.0/globals/CompressionStream/prototype/writable.mdx deleted file mode 100644 index b61ef0a458..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/CompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CompressionStream.writable - -The **`writable`** read-only property of the `CompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/CryptoKey.mdx b/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/CryptoKey.mdx deleted file mode 100644 index 038ef515f0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/CryptoKey.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# CryptoKey - -The **`CryptoKey`** interface represents a cryptographic key obtained from one of the [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) method [`importKey()`](../SubtleCrypto/prototype/importKey.mdx). - -## Instance properties - -- [`type`](./prototype/type.mdx) _**readonly**_ - - : The type of key the object represents. It may take one of the following values: `"secret"`, `"private"` or `"public"`. - -- [`extractable`](./prototype/extractable.mdx) _**readonly**_ - - : A boolean value indicating whether or not the key may be extracted. - -- [`algorithm`](./prototype/algorithm.mdx) _**readonly**_ - - : An object describing the algorithm for which this key can be used and any associated extra parameters. - -- [`usages`](./prototype/usages.mdx) _**readonly**_ - - : An `Array` of strings, indicating what can be done with the key. Possible values for array elements are `"encrypt"`, `"decrypt"`, `"sign"`, `"verify"`, `"deriveKey"`, `"deriveBits"`, `"wrapKey"`, and `"unwrapKey"`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/algorithm.mdx b/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/algorithm.mdx deleted file mode 100644 index daf96415fd..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/algorithm.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# algorithm - -The read-only **`algorithm`** property of the [`CryptoKey`](../CryptoKey.mdx) interface returns an object describing the algorithm for which this key can be used, and any associated extra parameters. - -The object returned depends of the algorithm used to generate the key. - -## Value - -An object matching: - -- [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) if the algorithm is any of the RSA variants. diff --git a/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/extractable.mdx b/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/extractable.mdx deleted file mode 100644 index 7d91cd2810..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/extractable.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# extractable - -The read-only **`extractable`** property indicates whether or not the key may be extracted. - -If the key cannot be exported, an exception will be thrown if an attempt to extract the key is made. - -## Value - -A boolean value that is `true` if the key can be exported and `false` if not. diff --git a/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/type.mdx b/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/type.mdx deleted file mode 100644 index 2c6cfdb868..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/type.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# type - -The read-only **`type`** property indicates which kind of key is represented by the object. It can have the following values: - -- `"secret"`: This key is a secret key for use with a symmetric algorithm. -- `"private"`: This key is the private half of an asymmetric algorithm's key pair. -- `"public"`: This key is the public half of an asymmetric algorithm's key pair. - -## Value - -One of the following strings: `"secret"`, `"private"`, or `"public"`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/usages.mdx b/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/usages.mdx deleted file mode 100644 index 43746ee711..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/CryptoKey/prototype/usages.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# usages - -The read-only **`usages`** property indicates what can be done with the key. - -## Value - -An `Array` of strings from the following list: - -- `"encrypt"`: The key may be used to encrypt messages. -- `"decrypt"`: The key may be used to decrypt messages. -- `"sign"`: The key may be used to sign messages. -- `"verify"`: The key may be used to verify signatures. -- `"deriveKey"`: The key may be used in deriving a new key. -- `"deriveBits"`: The key may be used in deriving bits. -- `"wrapKey"`: The key may be used to wrap a key. -- `"unwrapKey"`: The key may be used to unwrap a key. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DOMException/DOMException.mdx b/documentation/versioned_docs/version-3.9.0/globals/DOMException/DOMException.mdx deleted file mode 100644 index 160e40e774..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DOMException/DOMException.mdx +++ /dev/null @@ -1,107 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException() - -The **`DOMException()`** constructor returns a `DOMException` object with a specified message and name. - -## Syntax - -```js -new DOMException() -new DOMException(message) -new DOMException(message, name) -``` - -### Parameters - -- `message` _optional_ - - : A description of the exception. If not present, the empty string `''` is - used. -- `name` _optional_ - - : A string. If the specified name is a [standard error name](#error-names), then getting the [`code`](./code.mdx) property of the `DOMException` object will return the code number corresponding to the specified name. - -### Return value - -A newly created `DOMException` object. - -## Error names - -Common error names are listed here. Some APIs define their own sets of names, so this is not necessarily a complete list. - -Note that the following deprecated historical errors don't have an error name but instead have only a legacy constant code value and a legacy constant name: - -- Legacy code value: `2`, legacy constant name: `DOMSTRING_SIZE_ERR` -- Legacy code value: `6`, legacy constant name: `NO_DATA_ALLOWED_ERR` -- Legacy code value: `16`, legacy constant name: `VALIDATION_ERR` - -> **Note:** Because historically the errors were identified by a numeric value that corresponded with a named variable defined to have that value, some of the entries below indicate the legacy code value and constant name that were used in the past. - -- `IndexSizeError` - - : The index is not in the allowed range. (Legacy code value: `1` and legacy constant name: `INDEX_SIZE_ERR`) -- `HierarchyRequestError` - - : The node tree hierarchy is not correct. (Legacy code value: `3` and legacy constant name: `HIERARCHY_REQUEST_ERR`) -- `WrongDocumentError` - - : The object is in the wrong `Document`. (Legacy code value: `4` and legacy constant name: `WRONG_DOCUMENT_ERR`) -- `InvalidCharacterError` - - : The string contains invalid characters. (Legacy code value: `5` and legacy constant name: `INVALID_CHARACTER_ERR`) -- `NoModificationAllowedError` - - : The object cannot be modified. (Legacy code value: `7` and legacy constant name: `NO_MODIFICATION_ALLOWED_ERR`) -- `NotFoundError` - - : The object cannot be found here. (Legacy code value: `8` and legacy constant name: `NOT_FOUND_ERR`) -- `NotSupportedError` - - : The operation is not supported. (Legacy code value: `9` and legacy constant name: `NOT_SUPPORTED_ERR`) -- `InvalidStateError` - - : The object is in an invalid state. (Legacy code value: `11` and legacy constant name: `INVALID_STATE_ERR`) -- `InUseAttributeError` - - : The attribute is in use. (Legacy code value: `10` and legacy constant name: `INUSE_ATTRIBUTE_ERR`) -- `SyntaxError` - - : The string did not match the expected pattern. (Legacy code value: `12` and legacy constant name: `SYNTAX_ERR`) -- `InvalidModificationError` - - : The object cannot be modified in this way. (Legacy code value: `13` and legacy constant name: `INVALID_MODIFICATION_ERR`) -- `NamespaceError` - - : The operation is not allowed by Namespaces in XML. (Legacy code value: `14` and legacy constant name: `NAMESPACE_ERR`) -- `InvalidAccessError` - - : The object does not support the operation or argument. (Legacy code value: `15` and legacy constant name: `INVALID_ACCESS_ERR`) -- `TypeMismatchError` *deprecated* - - : The type of the object does not match the expected type. (Legacy code value: `17` and legacy constant name: `TYPE_MISMATCH_ERR`) This value is deprecated; the JavaScript `TypeError` exception is now raised instead of a `DOMException` with this value. -- `SecurityError` - - : The operation is insecure. (Legacy code value: `18` and legacy constant name: `SECURITY_ERR`) -- `NetworkError` - - : A network error occurred. (Legacy code value: `19` and legacy constant name: `NETWORK_ERR`) -- `AbortError` - - : The operation was aborted. (Legacy code value: `20` and legacy constant name: `ABORT_ERR`) -- `URLMismatchError` - - : The given URL does not match another URL. (Legacy code value: `21` and legacy constant name: `URL_MISMATCH_ERR`) -- `QuotaExceededError` - - : The quota has been exceeded. (Legacy code value: `22` and legacy constant name: `QUOTA_EXCEEDED_ERR`) -- `TimeoutError` - - : The operation timed out. (Legacy code value: `23` and legacy constant name: `TIMEOUT_ERR`) -- `InvalidNodeTypeError` - - : The node is incorrect or has an incorrect ancestor for this operation. (Legacy code value: `24` and legacy constant name: `INVALID_NODE_TYPE_ERR`) -- `DataCloneError` - - : The object can not be cloned. (Legacy code value: `25` and legacy constant name: `DATA_CLONE_ERR`) -- `EncodingError` - - : The encoding or decoding operation failed (No legacy code value and constant name). -- `NotReadableError` - - : The input/output read operation failed (No legacy code value and constant name). -- `UnknownError` - - : The operation failed for an unknown transient reason (e.g. out of memory) (No legacy code value and constant name). -- `ConstraintError` - - : A mutation operation in a transaction failed because a constraint was not satisfied (No legacy code value and constant name). -- `DataError` - - : Provided data is inadequate (No legacy code value and constant name). -- `TransactionInactiveError` - - : A request was placed against a transaction that is currently not active or is finished (No legacy code value and constant name). -- `ReadOnlyError` - - : The mutating operation was attempted in a "readonly" transaction (No legacy code value and constant name). -- `VersionError` - - : An attempt was made to open a database using a lower version than the existing version (No legacy code value and constant name). -- `OperationError` - - : The operation failed for an operation-specific reason (No legacy code value and constant name). -- `NotAllowedError` - - : The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (No legacy code value and constant name). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/globals/DOMException/code.mdx b/documentation/versioned_docs/version-3.9.0/globals/DOMException/code.mdx deleted file mode 100644 index 21b9836fa4..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DOMException/code.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.code - -The **`code`** read-only property of the `DOMException` interface returns one of the legacy [error code constants](./DOMException.mdx#error-names), or `0` if none match. - -This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the [`name`](./name.mdx) attribute. - -## Value - -One of the [error code constants](./DOMException.mdx#error-names), or `0` if none match. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DOMException/message.mdx b/documentation/versioned_docs/version-3.9.0/globals/DOMException/message.mdx deleted file mode 100644 index 44d3c6b8da..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DOMException/message.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.message - -The **`message`** read-only property of the `DOMException` interface returns a string representing a message or description associated with the given [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DOMException/name.mdx b/documentation/versioned_docs/version-3.9.0/globals/DOMException/name.mdx deleted file mode 100644 index 1dda11b92c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DOMException/name.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# DOMException.prototype.name - -The **`name`** read-only property of the `DOMException` interface returns a string that contains one of the strings associated with an [error name](./DOMException.mdx#error-names). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/DataView.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/DataView.mdx deleted file mode 100644 index 1145448be8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/DataView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView() - -The **`DataView()`** constructor is used to create `DataView` objects. - -## Syntax - -```js -new DataView(buffer) -new DataView(buffer, byteOffset) -new DataView(buffer, byteOffset, byteLength) -``` - -> **Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `buffer` - - : An existing `ArrayBuffer` to use as - the storage backing the new `DataView` object. -- `byteOffset` _**optional**_ - - : The offset, in bytes, to the first byte in the above buffer for the new view to - reference. If unspecified, the buffer view starts with the first byte. -- `byteLength` _**optional**_ - - : The number of elements in the byte array. If unspecified, the view's length will - match the buffer's length. - -### Return value - -A new `DataView` object representing the specified data buffer. - -### Exceptions - -- [`RangeError`](../RangeError/RangeError.mdx) - - - : Thrown if the `byteOffset` or `byteLength` parameter values - result in the view extending past the end of the buffer. - - For example, if the buffer is 16 bytes long, the `byteOffset` is 8, and - the `byteLength` is 10, this error is thrown because the resulting view - tries to extend 2 bytes past the total length of the buffer. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/buffer.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/buffer.mdx deleted file mode 100644 index 629d093b18..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/buffer.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.buffer - -The **`buffer`** accessor property represents the `ArrayBuffer` referenced by the `DataView` at construction time. - -## Description - -The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/byteLength.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/byteLength.mdx deleted file mode 100644 index 4cfe1225d7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/byteLength.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteLength - -The **`byteLength`** accessor property represents the length (in bytes) of the dataview. - -## Description - -The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/byteOffset.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/byteOffset.mdx deleted file mode 100644 index df3ec4757f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/byteOffset.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.byteOffset - -The **`byteOffset`** accessor property represents the offset (in bytes) of this view from the start of its `ArrayBuffer`. - -## Description - -The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getBigInt64.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getBigInt64.mdx deleted file mode 100644 index 5890a661ac..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getBigInt64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigInt64() - -The **`getBigInt64()`** method gets a signed 64-bit integer -(long long) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigInt64(byteOffset) -getBigInt64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getBigUint64.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getBigUint64.mdx deleted file mode 100644 index 2f66aa0046..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getBigUint64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getBigUint64() - -The **`getBigUint64()`** method gets an unsigned 64-bit integer -(unsigned long long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getBigUint64(byteOffset) -getBigUint64(byteOffset, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to read the data from. -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is read. - -### Return value - -A `BigInt`. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would read beyond the end - of the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getFloat32.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getFloat32.mdx deleted file mode 100644 index e64d2581ae..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getFloat32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat32() - -The **`getFloat32()`** method gets a signed 32-bit float -(float) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat32(byteOffset) -getFloat32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getFloat64.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getFloat64.mdx deleted file mode 100644 index 628e98a3af..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getFloat64.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getFloat64() - -The **`getFloat64()`** method gets a signed 64-bit float -(double) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getFloat64(byteOffset) -getFloat64(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 64-bit float number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getInt16.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getInt16.mdx deleted file mode 100644 index 4befd3ab4b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getInt16.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt16() - -The **`getInt16()`** method gets a signed 16-bit integer -(short) at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt16(byteOffset) -getInt16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getInt32.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getInt32.mdx deleted file mode 100644 index 3bad1280e1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getInt32.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt32() - -The **`getInt32()`** method gets a signed 32-bit integer (long) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt32(byteOffset) -getInt32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in bytes, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -A signed 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getInt8.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getInt8.mdx deleted file mode 100644 index 04ae5febf2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getInt8.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getInt8() - -The **`getInt8()`** method gets a signed 8-bit integer (byte) -at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getInt8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -A signed 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getUint16.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getUint16.mdx deleted file mode 100644 index def5906a6d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getUint16.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint16() - -The **`getUint16()`** method gets an unsigned 16-bit integer -(unsigned short) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint16(byteOffset) -getUint16(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 16-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getUint32.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getUint32.mdx deleted file mode 100644 index 9660ce01f2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getUint32.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint32() - -The **`getUint32()`** method gets an unsigned 32-bit integer -(unsigned long) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - - - -## Syntax - -```js -getUint32(byteOffset) -getUint32(byteOffset, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is read. - -### Return value - -An unsigned 32-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getUint8.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getUint8.mdx deleted file mode 100644 index aebc4edfba..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/getUint8.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.getUint8() - -The **`getUint8()`** method gets an unsigned 8-bit integer -(unsigned byte) at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -getUint8(byteOffset) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to read the data. - -### Return value - -An unsigned 8-bit integer number. - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would read beyond the end of - the view. - -## Description - -There is no alignment constraint; multi-byte values may be fetched from any offset. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setBigInt64.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setBigInt64.mdx deleted file mode 100644 index e3e55facf1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setBigInt64.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigInt64() - -The **`setBigInt64()`** method stores a signed 64-bit integer -(long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigInt64(byteOffset, value) -setBigInt64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - a signed 64-bit integer is - `2n ** (64n -1n) - 1n` (`9223372036854775807n`). Upon - overflow, it will be negative (`-9223372036854775808n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setBigUint64.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setBigUint64.mdx deleted file mode 100644 index ca80ac9b35..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setBigUint64.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setBigUint64() - -The **`setBigUint64()`** method stores an unsigned 64-bit -integer (unsigned long long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setBigUint64(byteOffset, value) -setBigUint64(byteOffset, value, littleEndian) -``` - -### Parameters - -- byteOffset - - : The offset, in bytes, from the start of the view to store the data from. -- value - - : The value to set as a `BigInt`. The highest possible value that fits in - an unsigned 64-bit integer is - `2n ** 64n - 1n` - (`18446744073709551615n`). Upon overflow, it will be zero - (`0n`). -- littleEndian - - : _**optional**_ Indicates whether the 64-bit int is stored in [little- or big-endian](https://developer.mozilla.org/docs/Glossary/Endianness) format. If - `false` or `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such that it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setFloat32.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setFloat32.mdx deleted file mode 100644 index 91e9a90c7a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setFloat32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat32() - -The **`setFloat32()`** method stores a signed 32-bit float -(float) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat32(byteOffset, value) -setFloat32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setFloat64.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setFloat64.mdx deleted file mode 100644 index 318332c029..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setFloat64.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setFloat64() - -The **`setFloat64()`** method stores a signed 64-bit float -(double) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setFloat64(byteOffset, value) -setFloat64(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 64-bit float is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setInt16.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setInt16.mdx deleted file mode 100644 index f13bd8de34..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setInt16.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt16() - -The **`setInt16()`** method stores a signed 16-bit integer -(short) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt16(byteOffset, value) -setInt16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setInt32.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setInt32.mdx deleted file mode 100644 index 07cc08d9a5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setInt32.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt32() - -The **`setInt32()`** method stores a signed 32-bit integer -(long) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt32(byteOffset, value) -setInt32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setInt8.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setInt8.mdx deleted file mode 100644 index 91b9201b0d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setInt8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setInt8() - -The **`setInt8()`** method stores a signed 8-bit integer (byte) -value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setInt8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setUint16.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setUint16.mdx deleted file mode 100644 index 75da220d7d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setUint16.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint16() - -The **`setUint16()`** method stores an unsigned 16-bit integer -(unsigned short) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint16(byteOffset, value) -setUint16(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 16-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setUint32.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setUint32.mdx deleted file mode 100644 index a5956d9026..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setUint32.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint32() - -The **`setUint32()`** method stores an unsigned 32-bit integer -(unsigned long) value at the specified byte offset from the start of the -[`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint32(byteOffset, value) -setUint32(byteOffset, value, littleEndian) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. -- `littleEndian` - - : _**optional**_ Indicates whether the 32-bit int is stored in - little- or big-endian format. If `false` or - `undefined`, a big-endian value is written. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setUint8.mdx b/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setUint8.mdx deleted file mode 100644 index 001859cf66..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DataView/prototype/setUint8.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DataView.prototype.setUint8() - -The **`setUint8()`** method stores an unsigned 8-bit integer -(byte) value at the specified byte offset from the start of the [`DataView`](../../../globals/DataView/DataView.mdx). - -## Syntax - -```js -setUint8(byteOffset, value) -``` - -### Parameters - -- `byteOffset` - - : The offset, in byte, from the start of the view where to store the data. -- `value` - - : The value to set. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -### Errors thrown - -- [`RangeError`](../../RangeError/RangeError.mdx) - - : Thrown if the `byteOffset` is set such as it would store beyond the end - of the view. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/Date.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/Date.mdx deleted file mode 100644 index bb636170d2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/Date.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date() - -The **`Date()`** constructor can create a `Date` instance or return a string representing the current time. - -## Syntax - -```js -new Date() -new Date(value) -new Date(dateString) -new Date(dateObject) - -new Date(year, monthIndex) -new Date(year, monthIndex, day) -new Date(year, monthIndex, day, hours) -new Date(year, monthIndex, day, hours, minutes) -new Date(year, monthIndex, day, hours, minutes, seconds) -new Date(year, monthIndex, day, hours, minutes, seconds, milliseconds) - -Date() -``` - -> **Note:** `Date()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -There are five basic forms for the `Date()` constructor: - -#### No parameters - -When no parameters are provided, the newly-created `Date` object represents the current date and time as of the time of instantiation. - -#### Time value or timestamp number - -- `value` - - : An integer value representing the number of milliseconds since January 1, 1970, 00:00:00 UTC (the ECMAScript epoch, equivalent to the UNIX epoch), with leap seconds ignored. Keep in mind that most [UNIX Timestamp](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16) functions are only accurate to the nearest second. - -#### Date string - -- `dateString` - - - : A string value representing a date, in a format recognized by the [`Date.parse()`](./parse.mdx) method. (The ECMA262 spec specifies a [simplified version of ISO 8601](https://tc39.es/ecma262/#sec-date-time-string-format), but other formats can be implementation-defined, which commonly include [IETF-compliant RFC 2822 timestamps](https://datatracker.ietf.org/doc/html/rfc2822#page-14).) - - > **Note:** When parsing date strings with the `Date` constructor (and `Date.parse`, they are equivalent), always make sure that the input conforms to the ISO 8601 format (`YYYY-MM-DDTHH:mm:ss.sssZ`) — the parsing behavior with other formats is implementation-defined and may not work across all browsers. Support for [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822) format strings is by convention only. A library can help if many different formats are to be accommodated. - > - > Date-only strings (e.g. `"1970-01-01"`) are treated as UTC, while date-time strings (e.g. `"1970-01-01T12:00"`) are treated as local. You are therefore also advised to make sure the input format is consistent between the two types. - -#### Date object - -- `dateObject` - - : An existing `Date` object. This effectively makes a copy of the existing `Date` object with the same date and time. This is equivalent to `new Date(dateObject.valueOf())`, except the `valueOf()` method is not called. - -When one parameter is passed to the `Date()` constructor, `Date` instances are specially treated. All other values are [converted to primitives](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion). If the result is a string, it will be parsed as a date string. Otherwise, the resulting primitive is further coerced to a number and treated as a timestamp. - -#### Individual date and time component values - -Given at least a year and month, this form of `Date()` returns a `Date` object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters. Any missing fields are given the lowest possible value (`1` for `day` and `0` for every other component). The parameter values are all evaluated against the local time zone, rather than UTC. - -If any parameter overflows its defined bounds, it "carries over". For example, if a `monthIndex` greater than `11` is passed in, those months will cause the year to increment; if a `minutes` greater than `59` is passed in, `hours` will increment accordingly, etc. Therefore, `new Date(1990, 12, 1)` will return January 1st, 1991; `new Date(2020, 5, 19, 25, 65)` will return 2:05 A.M. June 20th, 2020. - -Similarly, if any parameter underflows, it "borrows" from the higher positions. For example, `new Date(2020, 5, 0)` will return May 31st, 2020. - -- `year` - - : Integer value representing the year. Values from `0` to `99` map to the years `1900` to `1999`. All other values are the actual year. See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). -- `monthIndex` - - : Integer value representing the month, beginning with `0` for January to `11` for December. -- `day` _**optional**_ - - : Integer value representing the day of the month. The default is `1`. -- `hours` _**optional**_ - - : Integer value between `0` and `23` representing the hour of the day. Defaults to `0`. -- `minutes` _**optional**_ - - : Integer value representing the minute segment of a time. The default is `0` minutes past the hour. -- `seconds` _**optional**_ - - : Integer value representing the second segment of a time. The default is `0` seconds past the minute. -- `milliseconds` _**optional**_ - - : Integer value representing the millisecond segment of a time. The default is `0` milliseconds past the second. - -### Return value - -Calling `new Date()` (the `Date()` constructor) returns a [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) object. If called with an invalid date string, or if the date to be constructed will have a UNIX timestamp less than `-8,640,000,000,000,000` or greater than `8,640,000,000,000,000` milliseconds, it returns a `Date` object whose [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString) method returns the literal string `Invalid Date`. - -Calling the `Date()` function (without the `new` keyword) returns a string representation of the current date and time, exactly as `new Date().toString()` does. Any arguments given in a `Date()` function call (without the `new` keyword) are ignored; regardless of whether it's called with an invalid date string — or even called with any arbitrary object or other primitive as an argument — it always returns a string representation of the current date and time. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/UTC.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/UTC.mdx deleted file mode 100644 index 472ad546cf..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/UTC.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.UTC() - -The **`Date.UTC()`** method accepts parameters similar to the -`Date` constructor, but treats them as UTC. It returns the number of -milliseconds since January 1, 1970, 00:00:00 UTC. - - - -## Syntax - -```js -Date.UTC(year) -Date.UTC(year, monthIndex) -Date.UTC(year, monthIndex, day) -Date.UTC(year, monthIndex, day, hour) -Date.UTC(year, monthIndex, day, hour, minute) -Date.UTC(year, monthIndex, day, hour, minute, second) -Date.UTC(year, monthIndex, day, hour, minute, second, millisecond) -``` - -- `year` - - - : Integer value representing the year. - - Values from `0` to `99` map to the years - `1900` to `1999`. All other values are the actual year. - See the [example](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#interpretation_of_two-digit_years). - -- `monthIndex` _**optional**_ - - : An integer between `0` (January) and `11` (December) - representing the month. Since ECMAScript 2017 it defaults to `0` if - omitted. _(Up until ECMAScript 2016, `monthIndex` was a required - parameter. As of ES2017, it no longer is.)_ -- `day` _**optional**_ - - : An integer between `1` and `31` representing the day of the - month. If omitted, defaults to `1`. -- `hour` _**optional**_ - - : An integer between `0` and `23` representing the hours. If - omitted, defaults to `0`. -- `minute` _**optional**_ - - : An integer between `0` and `59` representing the minutes. If - omitted, defaults to `0`. -- `second` _**optional**_ - - : An integer between `0` and `59` representing the seconds. If - omitted, defaults to `0`. -- `millisecond` _**optional**_ - - : An integer between `0` and `999` representing the - milliseconds. If omitted, defaults to `0`. - -### Return value - -A number representing the number of milliseconds for the given date since January 1, -1970, 00:00:00, UTC. - -## Description - -`UTC()` takes comma-delimited date and time parameters and returns the -number of milliseconds between January 1, 1970, 00:00:00, universal time and the -specified date and time. - -Years between `0` and `99` are converted to a year in the -20th century `(1900 + year)`. For example, `95` is -converted to the year `1995`. - -The `UTC()` method differs from the `Date` constructor in two -ways: - -1. `Date.UTC()` uses universal time instead of the local time. -2. `Date.UTC()` returns a time value as a number instead of creating a - `Date` object. - -If a parameter is outside of the expected range, the `UTC()` method updates -the other parameters to accommodate the value. For example, if `15` is used -for `monthIndex`, the year will be incremented by 1 -`(year + 1)` and `3` will be used for the month. - -`UTC()` is a static method of `Date`, so it's called as -`Date.UTC()` rather than as a method of a `Date` instance. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/now.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/now.mdx deleted file mode 100644 index 369fba0f62..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/now.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.now() - -The static **`Date.now()`** method returns the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -## Syntax - -```js -Date.now() -``` - -### Return value - -A number representing the number of milliseconds elapsed since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/parse.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/parse.mdx deleted file mode 100644 index e39b5c110d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/parse.mdx +++ /dev/null @@ -1,123 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.parse() - -The **`Date.parse()`** method parses a string representation of -a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or -`NaN` if the string is unrecognized or, in some cases, contains illegal date -values (e.g. 2015-02-31). - -Only the [ISO 8601 format](https://tc39.es/ecma262/#sec-date-time-string-format) (`YYYY-MM-DDTHH:mm:ss.sssZ`) is explicitly specified to be supported. Other formats are implementation-defined and may not work across all browsers. A library can help if many different formats are to be accommodated. - -## Syntax - -```js -Date.parse(dateString) -``` - -### Parameters - -- `dateString` - - : A string representing [a simplification of the ISO 8601 calendar date extended format](#date_time_string_format). - (Other formats may be used, but results are implementation-dependent.) - -### Return value - -A number representing the milliseconds elapsed since January 1, 1970, 00:00:00 UTC and -the date obtained by parsing the given string representation of a date. If the argument -doesn't represent a valid date, [`NaN`](../NaN.mdx) is returned. - -## Description - -The `parse()` method takes a date string (such as -`"2011-10-10T14:48:00"`) and returns the number of milliseconds since January -1, 1970, 00:00:00 UTC. - -This function is useful for setting date values based on string values, for example in -conjunction with the [`setTime()`](./prototype/setTime.mdx) method and the -`Date` object. - -### Date Time String Format - -The standard string representation of a date time string is a simplification of the ISO -8601 calendar date extended format. -(See the section [Date Time String Format](https://tc39.es/ecma262/#sec-date-time-string-format) -in the ECMAScript specification for more details.) - -For example, `"2011-10-10"` (_date-only_ form), -`"2011-10-10T14:48:00"` (_date-time_ form), or -`"2011-10-10T14:48:00.000+09:00"` (_date-time_ form with milliseconds -and time zone) can be passed and will be parsed. When the time zone offset is absent, -date-only forms are interpreted as a UTC time and date-time forms are interpreted as -local time. - -While time zone specifiers are used during date string parsing to interpret the -argument, the value returned is always the number of milliseconds between January 1, -1970 00:00:00 UTC and the point in time represented by the argument or `NaN`. - -Because `parse()` is a static method of `Date`, it is called as -`Date.parse()` rather than as a method of a `Date` instance. - -### Fall-back to implementation-specific date formats - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -The ECMAScript specification states: If the String does not conform to the standard -format the function may fall back to any implementation–specific heuristics or -implementation–specific parsing algorithm. Unrecognizable strings or dates containing -illegal element values in ISO formatted strings shall cause `Date.parse()` to -return [`NaN`](../NaN.mdx). - -However, invalid values in date strings not recognized as simplified ISO format as -defined by ECMA-262 may or may not result in [`NaN`](../NaN.mdx), depending on the browser -and values provided, e.g.: - -```js -// Non-ISO string with invalid date values -new Date("23/25/2014"); -``` - -will be treated as a local date of 25 November, 2015 in Firefox 30 and an invalid date -in Safari 7. - -However, if the string is recognized as an ISO format string and it contains invalid -values, it will return [`NaN`](../NaN.mdx): - -```js -// ISO string with invalid values -new Date("2014-25-23").toISOString(); -// throws "RangeError: invalid date" -``` - -SpiderMonkey's implementation-specific heuristic can be found in [`jsdate.cpp`](https://searchfox.org/mozilla-central/source/js/src/jsdate.cpp?rev=64553c483cd1#889). -The string `"10 06 2014"` is an example of a non-conforming ISO format and -thus falls back to a custom routine. See also this [rough outline](https://bugzilla.mozilla.org/show_bug.cgi?id=1023155#c6) on -how the parsing works. - -```js -new Date("10 06 2014"); -``` - -will be treated as a local date of 6 October, 2014, and not 10 June, 2014. - -Other examples: - -```js -new Date("foo-bar 2014").toString(); -// returns: "Invalid Date" - -Date.parse("foo-bar 2014"); -// returns: NaN -``` - -### Differences in assumed time zone - -> **Note:** This section contains implementation-specific behavior that can be inconsistent -> across implementations. - -Given a non-standard date string of `"March 7, 2014"`, `parse()` assumes a local time zone, but given a simplification of the ISO 8601 calendar date extended format such as `"2014-03-07"`, it will assume a time zone of UTC. Therefore `Date` objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/@@toPrimitive.mdx deleted file mode 100644 index 0c9c5443f1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype\[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a `Date` -object to a primitive value. - -## Syntax - -```js -Date()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the given `Date` object. Depending on the argument, -the method can return either a string or a number. - -## Description - -The `[Symbol.toPrimitive]()` method of the `Date` object returns a -primitive value, that is either of type number or of type string. - -If `hint` is `string` or `default`, -`[Symbol.toPrimitive]()` tries to call the [`toString`](../../Object/prototype/toString.mdx) method. If the `toString` property does not exist, it tries to -call the [`valueOf`](../../Object/prototype/valueOf.mdx) method and if the -`valueOf` does not exist either, `[Symbol.toPrimitive]()` throws a -[`TypeError`](../../../globals/TypeError/TypeError.mdx). - -If `hint` is `number`, `[Symbol.toPrimitive]()` first tries -to call `valueOf`, and if that fails, it calls `toString`. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getDate.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getDate.mdx deleted file mode 100644 index 56d9107966..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getDate.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDate() - -The **`getDate()`** method returns the day of the month for the -specified date according to local time. - -## Syntax - -```js -getDate() -``` - -### Return value - -An integer number, between 1 and 31, representing the day of the month for the given -date according to local time. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getDay.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getDay.mdx deleted file mode 100644 index 84e9c2ea49..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getDay.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getDay() - -The **`getDay()`** method returns the -day of the week for the specified date according to local time, where 0 represents -Sunday. For the day of the month, see [`Date.prototype.getDate()`](./getDate.mdx). - -## Syntax - -```js -getDay() -``` - -### Return value - -An integer number, between 0 and 6, corresponding to the day of the week for the given -date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getFullYear.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getFullYear.mdx deleted file mode 100644 index 595f659fa1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getFullYear() - -The **`getFullYear()`** method returns the year of the -specified date according to local time. - -Use this method instead of the [`Date.prototype.getYear()`](./getYear.mdx) method. - -## Syntax - -```js -getFullYear() -``` - -### Return value - -A number corresponding to the year of the given date, according to local time. - -## Description - -The value returned by `getFullYear()` is an absolute number. For dates -between the years 1000 and 9999, `getFullYear()` returns a four-digit number, -for example, 1995. Use this function to make sure a year is compliant with years after -2000\. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getHours.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getHours.mdx deleted file mode 100644 index d5e84b9ad7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getHours.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getHours() - -The **`getHours()`** method returns the hour for the specified -date, according to local time. - -## Syntax - -```js -getHours() -``` - -### Return value - -An integer number, between 0 and 23, representing the hour for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getMilliseconds.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getMilliseconds.mdx deleted file mode 100644 index 612ffbf9da..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getMilliseconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMilliseconds() - -The **`getMilliseconds()`** method returns the milliseconds in -the specified date according to local time. - -## Syntax - -```js -getMilliseconds() -``` - -### Return value - -A number, between 0 and 999, representing the milliseconds for the given date according -to local time. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getMinutes.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getMinutes.mdx deleted file mode 100644 index aa332c8b95..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getMinutes.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMinutes() - -The **`getMinutes()`** method returns the minutes in the -specified date according to local time. - -## Syntax - -```js -getMinutes() -``` - -### Return value - -An integer number, between 0 and 59, representing the minutes in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getMonth.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getMonth.mdx deleted file mode 100644 index be75f56fae..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getMonth.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getMonth() - -The **`getMonth()`** method returns the month in the specified -date according to local time, as a zero-based value (where zero indicates the first -month of the year). - -## Syntax - -```js -getMonth() -``` - -### Return value - -An integer number, between 0 and 11, representing the month in the given date according -to local time. 0 corresponds to January, 1 to February, and so on. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getSeconds.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getSeconds.mdx deleted file mode 100644 index bebafbcc9e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getSeconds.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getSeconds() - -The **`getSeconds()`** method returns the seconds in the -specified date according to local time. - -## Syntax - -```js -getSeconds() -``` - -### Return value - -An integer number, between 0 and 59, representing the seconds in the given date -according to local time. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getTime.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getTime.mdx deleted file mode 100644 index 38c1c6c399..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getTime.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTime() - -The **`getTime()`** method returns the number of milliseconds since the [epoch](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps), which is defined as the midnight at the beginning of January 1, 1970, UTC. - -You can use this method to help assign a date and time to another `Date` -object. This method is functionally equivalent to the [`Date.prototype.valueOf()`](./valueOf.mdx) method. - -## Syntax - -```js -getTime() -``` - -### Return value - -A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and -the given date. - -## Description - -To offer protection against timing attacks and fingerprinting, the precision of -`new Date().getTime()` might get rounded depending on browser settings. - -```js -// reduced time precision (2ms) in Firefox 60 -new Date().getTime(); -// 1519211809934 -// 1519211810362 -// 1519211811670 -// … - -// reduced time precision with `privacy.resistFingerprinting` enabled -new Date().getTime(); -// 1519129853500 -// 1519129858900 -// 1519129864400 -// … -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getTimezoneOffset.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getTimezoneOffset.mdx deleted file mode 100644 index f8d426d1a0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getTimezoneOffset.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getTimezoneOffset() - -The **`getTimezoneOffset()`** method returns the difference, in minutes, between a date as evaluated in the UTC time zone, and the same date as evaluated in the local time zone. - -## Syntax - -```js -getTimezoneOffset() -``` - -### Return value - -The difference, in minutes, between the date as evaluated in the UTC time zone and as evaluated in the local time zone. The actual local time algorithm is implementation-defined, and the return value is allowed to be zero in runtimes without appropriate data. - -## Description - -`date.getTimezoneOffset()` returns the difference, in minutes, between `date` as evaluated in the UTC time zone and as evaluated in the local time zone — that is, the time zone of the host system in which the browser is being used (if the code is run from the Web in a browser), or otherwise the host system of whatever JavaScript runtime (for example, a Node.js environment) the code is executed in. - -### Negative values and positive values - -The number of minutes returned by `getTimezoneOffset()` is positive if the local time zone is behind UTC, and negative if the local time zone is ahead of UTC. For example, for UTC+10, `-600` will be returned. - -| Current time zone | Return value | -| ----------------- | ------------ | -| UTC-8 | 480 | -| UTC | 0 | -| UTC+3 | -180 | - -### Varied results in Daylight Saving Time (DST) regions - -In a region that annually shifts in and out of Daylight Saving Time (DST), as `date` varies, the number of minutes returned by calling `getTimezoneOffset()` can be non-uniform. - -> **Note:** `getTimezoneOffset()`'s behavior will never differ based on the time when the code is run — its behavior is always consistent when running in the same region. Only the value of `date` affects the result. - -In most implementations, the [IANA time zone database](https://en.wikipedia.org/wiki/Daylight_saving_time#IANA_time_zone_database) (tzdata) is used to precisely determine the offset of the local timezone at the moment of the `date`. However, if such information is unavailable, an implementation may return zero. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCDate.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCDate.mdx deleted file mode 100644 index c78c56720a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCDate.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDate() - -The **`getUTCDate()`** method returns the day of the month (from -1 to 31) in the specified date according to universal time. - -## Syntax - -```js -getUTCDate() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number ranging from 1 to 31 -representing day of month for the given date, according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCDay.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCDay.mdx deleted file mode 100644 index a8b8056934..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCDay.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCDay() - -The **`getUTCDay()`** method returns the day of the week in the -specified date according to universal time, where 0 represents Sunday. - -## Syntax - -```js -getUTCDay() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer number corresponding to the day -of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, -2 for Tuesday, and so on. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCFullYear.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCFullYear.mdx deleted file mode 100644 index 8fbb838eae..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCFullYear.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCFullYear() - -The **`getUTCFullYear()`** method returns the year in the -specified date according to universal time. - -## Syntax - -```js -getUTCFullYear() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer representing the year in the given date -according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -## Description - -The value returned by `getUTCFullYear()` is an absolute number that is -compliant with year-2000, for example, 1995. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCHours.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCHours.mdx deleted file mode 100644 index d5725c8dbd..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCHours.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCHours() - -The **`getUTCHours()`** method returns the hours in the -specified date according to universal time. - -## Syntax - -```js -getUTCHours() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 23, representing the hours in the given date according -to Coordinated Universal Time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCMilliseconds.mdx deleted file mode 100644 index 1d50bf4591..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCMilliseconds.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMilliseconds() - -The **`getUTCMilliseconds()`** method returns the milliseconds -portion of the time object's value according to universal time. - -## Syntax - -```js -getUTCMilliseconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 999, representing -the milliseconds portion of the given `Date` object according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. - -Not to be confused with Unix epoch time. To get the total milliseconds since 1970/01/01, -use the [`getTime()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) method. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCMinutes.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCMinutes.mdx deleted file mode 100644 index 303b0d07f6..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCMinutes.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMinutes() - -The **`getUTCMinutes()`** method returns the minutes in the -specified date according to universal time. - -## Syntax - -```js -getUTCMinutes() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, -representing the minutes in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCMonth.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCMonth.mdx deleted file mode 100644 index 056d3231ad..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCMonth.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCMonth() - -The **`getUTCMonth()`** returns the month of the specified date -according to universal time, as a zero-based value (where zero indicates the first month -of the year). - -## Syntax - -```js -getUTCMonth() -``` - -### Return value - -A number. If the `Date` object represents a valid date, an integer number, between 0 and 11, -corresponding to the month of the given date according to universal time. 0 for January, -1 for February, 2 for March, and so on. Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCSeconds.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCSeconds.mdx deleted file mode 100644 index 0dab99e177..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getUTCSeconds.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getUTCSeconds() - -The **`getUTCSeconds()`** method returns the seconds in the -specified date according to universal time. - -## Syntax - -```js -getUTCSeconds() -``` - -### Return value - -A number. -If the `Date` object represents a valid date, an integer between 0 and 59, representing -the seconds in the given date according to universal time. -Otherwise, [`NaN`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/NaN) -if the `Date` object doesn't represent a valid date. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getYear.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getYear.mdx deleted file mode 100644 index 69c0c24aa0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/getYear.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.getYear() - -The **`getYear()`** method returns the year in the specified -date according to local time. Because `getYear()` does not return full years -("year 2000 problem"), it is no longer used and has been replaced by the -[`Date.prototype.getFullYear()`](./getFullYear.mdx) method. - -## Syntax - -```js -getYear() -``` - -### Return value - -A number representing the year of the given date, according to local time, minus 1900. - -## Description - -- For years greater than or equal to 2000, the value returned by - `getYear()` is 100 or greater. For example, if the year is 2026, - `getYear()` returns 126. -- For years between and including 1900 and 1999, the value returned by - `getYear()` is between 0 and 99. For example, if the year is 1976, - `getYear()` returns 76. -- For years less than 1900, the value returned by `getYear()` is less than 0. For example, if the year is 1800, `getYear()` returns -100. - -To take into account years before and after 2000, you should use -[`Date.prototype.getFullYear()`](./getFullYear.mdx) instead of -`getYear()` so that the year is specified in full. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setDate.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setDate.mdx deleted file mode 100644 index b9b0e5ae63..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setDate.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setDate() - -The **`setDate()`** method changes the day of the month of a given `Date` instance, based on local time. - -To instead change the day of the month for a given `Date` instance based on UTC time, use the [`Date.prototype.setUTCDate()`](./setUTCDate.mdx) method. - -## Syntax - -```js -setDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the -`Date` object is also changed in place). - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setFullYear.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setFullYear.mdx deleted file mode 100644 index 9310a7cc84..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setFullYear() - -The **`setFullYear()`** method sets the full year for a -specified date according to local time. Returns new timestamp. - -## Syntax - -```js -setFullYear(yearValue) -setFullYear(yearValue, monthValue) -setFullYear(yearValue, monthValue, dateValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dateValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dateValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dateValue` parameters, the values returned from the -[`Date.prototype.getMonth()`](./getMonth.mdx) and -[`Date.prototype.getDate()`](./getDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setFullYear()` -attempts to update the other parameters and the date information in the -`Date` object accordingly. For example, if you specify 15 for -`monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setHours.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setHours.mdx deleted file mode 100644 index fed986942b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setHours.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setHours() - -The **`setHours()`** method sets the hours for a specified date -according to local time, and returns the number of milliseconds since January 1, 1970 -00:00:00 UTC until the time represented by the updated `Date` instance. - -## Syntax - -```js -setHours(hoursValue) -setHours(hoursValue, minutesValue) -setHours(hoursValue, minutesValue, secondsValue) -setHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : Ideally, an integer between 0 and 23, representing the hour. If a value greater than - 23 is provided, the datetime will be incremented by the extra hours. -- `minutesValue` - - : Optional. Ideally, an integer between 0 and 59, representing the minutes. If a value - greater than 59 is provided, the datetime will be incremented by the extra minutes. -- `secondsValue` - - : Optional. Ideally, an integer between 0 and 59, representing the seconds. If a value - greater than 59 is provided, the datetime will be incremented by the extra seconds. If - you specify the `secondsValue` parameter, you must also specify - the `minutesValue`. -- `msValue` - - : Optional. Ideally, a number between 0 and 999, representing the milliseconds. If a - value greater than 999 is provided, the datetime will be incremented by the extra - milliseconds. If you specify the `msValue` parameter, you must - also specify the `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getMinutes()`](./getMinutes.mdx), -[`Date.prototype.getSeconds()`](./getSeconds.mdx), and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setMilliseconds.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setMilliseconds.mdx deleted file mode 100644 index d5d59807e1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setMilliseconds.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMilliseconds() - -The **`setMilliseconds()`** method sets the milliseconds for a -specified date according to local time. - -## Syntax - -```js -setMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you specify a number outside the expected range, the date information in the -`Date` object is updated accordingly. For example, if you specify 1005, the -number of seconds is incremented by 1, and 5 is used for the milliseconds. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setMinutes.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setMinutes.mdx deleted file mode 100644 index 8c4b41665a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setMinutes.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMinutes() - -The **`setMinutes()`** method sets the minutes for a specified -date according to local time. - -## Syntax - -```js -setMinutes(minutesValue) -setMinutes(minutesValue, secondsValue) -setMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getSeconds()`](./getSeconds.mdx) and -[`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) methods are used. - -If a parameter you specify is outside of the expected range, `setMinutes()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setMonth.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setMonth.mdx deleted file mode 100644 index 6a62496e29..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setMonth.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setMonth() - -The **`setMonth()`** method sets the month for a specified date according to the currently set year. - -## Syntax - -```js -setMonth(monthValue) -setMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : A zero-based integer representing the month of the year offset from the start of the - year. So, 0 represents January, 11 represents December, -1 represents December of the - previous year, and 12 represents January of the following year. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value -returned from the [`Date.prototype.getDate()`](./getDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be -incremented by 1, and 3 will be used for month. - -The current day of month will have an impact on the behavior of this method. -Conceptually it will add the number of days given by the current day of the month to the -1st day of the new month specified as the parameter, to return the new date. -For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016. -This is because in 2016 February had 29 days. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setSeconds.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setSeconds.mdx deleted file mode 100644 index c851c0820a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setSeconds() - -The **`setSeconds()`** method sets the seconds for a specified -date according to local time. - -## Syntax - -```js -setSeconds(secondsValue) -setSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` _**optional**_ - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned -from the [`Date.prototype.getMilliseconds()`](./getMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, `setSeconds()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes stored -in the `Date` object will be incremented by 1, and 40 will be used for -seconds. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setTime.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setTime.mdx deleted file mode 100644 index f614e2699b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setTime.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setTime() - -The **`setTime()`** method sets the `Date` object -to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC. - -## Syntax - -```js -setTime(timeValue) -``` - -### Parameters - -- `timeValue` - - : An integer representing the number of milliseconds since 1 January 1970, 00:00:00 - UTC. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date -(effectively, the value of the argument). - -## Description - -Use the `setTime()` method to help assign a date and time to another -`Date` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCDate.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCDate.mdx deleted file mode 100644 index 8bca964139..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCDate.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCDate() - -The **`setUTCDate()`** method changes the day of the month of a given `Date` instance, based on UTC time. - -To instead change the day of the month for a given `Date` instance based on local time, use the [`Date.prototype.setDate()`](././setDate.mdx) method. - -## Syntax - -```js -setUTCDate(dayValue) -``` - -### Parameters - -- `dayValue` - - : An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If the `dayValue` is outside of the range of date values for the month, `setDate()` will update the `Date` object accordingly. - -For example, if 0 is provided for `dayValue`, the date will be set to the last day of the previous month. If you use 40 for `dayValue`, and the month stored in the `Date` object is June, the day will be changed to 10 and the month will be incremented to July. - -If a negative number is provided for `dayValue`, the date will be set counting backwards from the last day of the previous month. -1 would result in the date being set to 1 day before the last day of the previous month. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCFullYear.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCFullYear.mdx deleted file mode 100644 index 32a7209c7d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCFullYear.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCFullYear() - -The **`setUTCFullYear()`** method sets the full year for a -specified date according to universal time. - -## Syntax - -```js -setUTCFullYear(yearValue) -setUTCFullYear(yearValue, monthValue) -setUTCFullYear(yearValue, monthValue, dayValue) -``` - -### Parameters - -- `yearValue` - - : An integer specifying the numeric value of the year, for example, 1995. -- `monthValue` - - : Optional. An integer between 0 and 11 representing the months January through - December. -- `dayValue` - - : Optional. An integer between 1 and 31 representing the day of the month. If you - specify the `dayValue` parameter, you must also specify the - `monthValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `monthValue` and -`dayValue` parameters, the values returned from the -[`Date.prototype.getUTCMonth()`](./getUTCMonth.mdx) and -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) methods are used. - -If a parameter you specify is outside of the expected range, -`setUTCFullYear()` attempts to update the other parameters and the date -information in the `Date` object accordingly. For example, if you specify 15 -for `monthValue`, the year is incremented by 1 -(`yearValue + 1`), and 3 is used for the month. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCHours.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCHours.mdx deleted file mode 100644 index c4aac51b1b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCHours.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCHours() - -The **`setUTCHours()`** method sets the hour for a specified -date according to universal time, and returns the number of milliseconds since January -1, 1970 00:00:00 UTC until the time represented by the updated `Date` -instance. - -## Syntax - -```js -setUTCHours(hoursValue) -setUTCHours(hoursValue, minutesValue) -setUTCHours(hoursValue, minutesValue, secondsValue) -setUTCHours(hoursValue, minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `hoursValue` - - : An integer between 0 and 23, representing the hour. -- `minutesValue` - - : Optional. An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between January 1, 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `minutesValue`, -`secondsValue`, and `msValue` parameters, -the values returned from the [`Date.prototype.getUTCMinutes()`](./getUTCMinutes.mdx), [`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx), -and [`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods -are used. - -If a parameter you specify is outside of the expected range, `setUTCHours()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 100 for `secondsValue`, the minutes will -be incremented by 1 (`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCMilliseconds.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCMilliseconds.mdx deleted file mode 100644 index 5e6b44fd66..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCMilliseconds.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMilliseconds() - -The **`setUTCMilliseconds()`** method sets the milliseconds for -a specified date according to universal time. - -## Syntax - -```js -setUTCMilliseconds(millisecondsValue) -``` - -### Parameters - -- `millisecondsValue` - - : A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If a parameter you specify is outside of the expected range, -`setUTCMilliseconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 1100 for -`millisecondsValue`, the seconds stored in the `Date` -object will be incremented by 1, and 100 will be used for milliseconds. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCMinutes.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCMinutes.mdx deleted file mode 100644 index fff98105a1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCMinutes.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMinutes() - -The **`setUTCMinutes()`** method sets the minutes for a -specified date according to universal time. - -## Syntax - -```js -setUTCMinutes(minutesValue) -setUTCMinutes(minutesValue, secondsValue) -setUTCMinutes(minutesValue, secondsValue, msValue) -``` - -### Parameters - -- `minutesValue` - - : An integer between 0 and 59, representing the minutes. -- `secondsValue` - - : Optional. An integer between 0 and 59, representing the seconds. If you specify the - `secondsValue` parameter, you must also specify the - `minutesValue`. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. If you specify - the `msValue` parameter, you must also specify the - `minutesValue` and `secondsValue`. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `secondsValue` and -`msValue` parameters, the values returned from -[`Date.prototype.getUTCSeconds()`](./getUTCSeconds.mdx) and -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) methods are -used. - -If a parameter you specify is outside of the expected range, -`setUTCMinutes()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes will be incremented by 1 -(`minutesValue + 1`), and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCMonth.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCMonth.mdx deleted file mode 100644 index 3d840bf321..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCMonth.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCMonth() - -The **`setUTCMonth()`** method sets the month for a specified -date according to universal time. - -## Syntax - -```js -setUTCMonth(monthValue) -setUTCMonth(monthValue, dayValue) -``` - -### Parameters - -- `monthValue` - - : An integer between 0 and 11, representing the months January through December. -- `dayValue` - - : Optional. An integer from 1 to 31, representing the day of the month. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `dayValue` parameter, the value returned from the -[`Date.prototype.getUTCDate()`](./getUTCDate.mdx) method is used. - -If a parameter you specify is outside of the expected range, `setUTCMonth()` -attempts to update the date information in the `Date` object accordingly. -For example, if you use 15 for `monthValue`, the year will be incremented by -1, and 3 will be used for month. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCSeconds.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCSeconds.mdx deleted file mode 100644 index e14160259d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setUTCSeconds.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setUTCSeconds() - -The **`setUTCSeconds()`** method sets the seconds for a -specified date according to universal time. - -## Syntax - -```js -setUTCSeconds(secondsValue) -setUTCSeconds(secondsValue, msValue) -``` - -### Parameters - -- `secondsValue` - - : An integer between 0 and 59, representing the seconds. -- `msValue` - - : Optional. A number between 0 and 999, representing the milliseconds. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If you do not specify the `msValue` parameter, the value returned from the -[`Date.prototype.getUTCMilliseconds()`](./getUTCMilliseconds.mdx) method is -used. - -If a parameter you specify is outside of the expected range, -`setUTCSeconds()` attempts to update the date information in the -`Date` object accordingly. For example, if you use 100 for -`secondsValue`, the minutes stored in the `Date` object will be -incremented by 1, and 40 will be used for seconds. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setYear.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setYear.mdx deleted file mode 100644 index 7882fc0d3f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/setYear.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.setYear() - -The legacy **`setYear()`** method sets the year for a specified date according to local time. - -However, the way the legacy `setYear()` method sets year values is different from how the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method sets year values — and in some cases, also different from how `new Date()` and [`Date.parse()`](../parse.mdx) set year values. Specifically, given two-digit numbers, such as `22` and `61`: - -- `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for [`Date.parse()`](../parse.mdx)). - -- [`Date.prototype.setFullYear()`](./setFullYear.mdx) does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`. - -Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred [`Date.prototype.setFullYear()`](./setFullYear.mdx) method. - -## Syntax - -```js -setYear(yearValue) -``` - -### Parameters - -- `yearValue` - - : An integer. - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. - -## Description - -If `yearValue` is a number between 0 and 99 (inclusive), then the year for -`dateObj` is set to `1900 + yearValue`. Otherwise, the year for -`dateObj` is set to `yearValue`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toDateString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toDateString.mdx deleted file mode 100644 index 8cb862ba16..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toDateString.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toDateString() - -The **`toDateString()`** method returns the date portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toDateString() -``` - -### Return value - -A string representing the date portion of the given `Date` object in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the _date_ part in English. It always uses the following format, separated by spaces: - -1. First three letters of the week day name -2. First three letters of the month name -3. Two-digit day of the month, padded on the left a zero if necessary -4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign - -For example: "Thu Jan 01 1970". - -- If you want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toISOString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toISOString.mdx deleted file mode 100644 index e02d4f27e7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toISOString.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toISOString() - -The **`toISOString()`** method returns a string in _simplified_ extended ISO format ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)), which is always 24 or 27 characters long (`YYYY-MM-DDTHH:mm:ss.sssZ` or `±YYYYYY-MM-DDTHH:mm:ss.sssZ`, respectively). The timezone is always zero UTC offset, as denoted by the suffix `Z`. - -## Syntax - -```js -toISOString() -``` - -### Return value - -A string representing the given date in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format according to universal time. It's the same format as the one required to be recognized by [`Date.parse()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/parse#date_time_string_format). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toJSON.mdx deleted file mode 100644 index 12e72543db..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toJSON.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toJSON() - -The **`toJSON()`** method returns a string representation of -the `Date` object. - -## Syntax - -```js -toJSON() -``` - -### Return value - -A string representation of the given date. - -## Description - -`Date` instances refer to a specific point in time. `toJSON()` calls the object's [`Date.prototype.toISOString()`](./toISOString.mdx) method, which returns a string representing the `Date` object's value. This method is generally intended to, by default, usefully serialize `Date` objects during [JSON](https://developer.mozilla.org/docs/Glossary/JSON) serialization, which can then be deserialized using the [`Date()` constructor](../Date.mdx) or [`Date.parse()`](../parse.mdx) as the reviver of [`JSON.parse()`](../../JSON/parse.mdx). - -The method first attempts to convert its `this` value [to a primitive](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) by calling its [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) (with `"number"` as hint), [`valueOf()`](../../Object/prototype/valueOf.mdx), and [`toString()`](../../Object/prototype/toString.mdx) methods, in that order. If the result is a [non-finite](../../Number/isFinite.mdx) number, `null` is returned. (This generally corresponds to an invalid date, whose [`valueOf()`](./valueOf.mdx) returns [`NaN`](../../NaN.mdx).) Otherwise, if the converted primitive is not a number or is a finite number, the return value of `this.toISOString()` is returned. - -Note that the method does not check whether the `this` value is a valid `Date` object. However, calling `Date.prototype.toJSON()` on non-`Date` objects does not have well-defined semantics. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toLocaleDateString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toLocaleDateString.mdx deleted file mode 100644 index 039939db24..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toLocaleDateString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleDateString() - -The **`toLocaleDateString()`** method returns a string with a language-sensitive representation of the date portion of the specified date in the user agent's timezone. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleDateString() -toLocaleDateString(locales) -toLocaleDateString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. The `timeStyle` option must be undefined, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) would be thrown. If `weekday`, `year`, `month`, and `day` are all undefined, then `year`, `month`, and `day` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the date portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toLocaleString.mdx deleted file mode 100644 index 784e9d78a9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toLocaleString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `weekday`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `year`, `month`, `day`, `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the given date according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toLocaleTimeString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toLocaleTimeString.mdx deleted file mode 100644 index 19e3bce27a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toLocaleTimeString.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toLocaleTimeString() - -The **`toLocaleTimeString()`** method returns a string with a language-sensitive representation of the time portion of the date. In implementations with [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) support, this method simply calls `Intl.DateTimeFormat`. - -## Syntax - -```js -toLocaleTimeString() -toLocaleTimeString(locales) -toLocaleTimeString(locales, options) -``` - -### Parameters - -The `locales` and `options` arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.DateTimeFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat), these parameters correspond exactly to the [`Intl.DateTimeFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) constructor's parameters. Implementations without `Intl.DateTimeFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#locales) parameter of the `Intl.DateTimeFormat()` constructor. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options) parameter of the `Intl.DateTimeFormat()` constructor. If `dayPeriod`, `hour`, `minute`, `second`, and `fractionalSecondDigits` are all undefined, then `hour`, `minute`, `second` will be set to `"numeric"`. - - In implementations without `Intl.DateTimeFormat` support, this parameter is ignored. - -See the [`Intl.DateTimeFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) for details on these parameters and how to use them. - -### Return value - -A string representing the time portion of the given `Date` instance according to language-specific conventions. - -In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `options` has been normalized as described above. - -## Performance - -When formatting large numbers of dates, it is better to create an [`Intl.DateTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) object and use its [`format()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format) method. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toString.mdx deleted file mode 100644 index 9387bbe358..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toString() - -The **`toString()`** method returns a string representing the specified `Date` object interpreted in the local timezone. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the given date. - -## Description - -The `Date` object overrides the `toString()` method of `Object`. `Date.prototype.toString()` returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time — it joins the string representation specified in [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) and [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString) together, adding a space in between. - -For example: "Thu Jan 01 1970 04:42:04 GMT+0000 (Coordinated Universal Time)" - -The `toString()` method is automatically called when a date is coerced to a string, such as `const today = 'Today is ' + new Date()`. - -`Date.prototype.toString()` must be called on `Date` instances. If the `this` value does not inherit from `Date.prototype`, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- If you only want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you only want to get the _time_ part, use [`toTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toTimeString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toTimeString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toTimeString.mdx deleted file mode 100644 index c7dd4e3ed6..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toTimeString.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toTimeString() - -The **`toTimeString()`** method returns the time portion of a `Date` object interpreted in the local timezone in English. - -## Syntax - -```js -toTimeString() -``` - -### Return value - -A string representing the time portion of the given date in human readable form in English. - -## Description - -`Date` instances refer to a specific point in time. `toTimeString()` interprets the date in the local timezone and formats the _time_ part in English. It always uses the format of `hh:mm:ss GMT±xxxx (TZ)`, where: - -| Format String | Description | -| ------------- | ----------------------------------------------------------------------------------------------------- | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | -| `±xxxx` | The local timezone's offset — two digits for hours and two digits for minutes (e.g. `-0500`, `+0800`) | -| `TZ` | The timezone's name (e.g. `PDT`, `PST`) | - -For example: "04:42:04 GMT+0000 (Coordinated Universal Time)". - -- If you want to get the _date_ part, use [`toDateString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString). -- If you want to get both the date and time, use [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toString). -- If you want to make the date interpreted as UTC instead of local timezone, use [`toUTCString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString). -- If you want to format the date in a more user-friendly format (e.g. localization), use [`toLocaleTimeString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toUTCString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toUTCString.mdx deleted file mode 100644 index 8b04d6b5bf..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/toUTCString.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.toUTCString() - -The **`toUTCString()`** method converts a date to a string, interpreting it in the UTC time zone. `toGMTString()` is an alias of this method. - -Based on [rfc7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) and modified according to [ECMA-262 toUTCString](https://tc39.es/ecma262/#sec-date.prototype.toutcstring), it can have negative values. - -## Syntax - -```js -toUTCString() -``` - -### Return value - -A string representing the given date using the UTC time zone. - -## Description - -The value returned by `toUTCString()` is a string in the form `Www, dd Mmm yyyy hh:mm:ss GMT`, where: - -| Format String | Description | -| ------------- | ------------------------------------------------------------ | -| `Www` | Day of week, as three letters (e.g. `Sun`, `Mon`) | -| `dd` | Day of month, as two digits with leading zero if required | -| `Mmm` | Month, as three letters (e.g. `Jan`, `Feb`) | -| `yyyy` | Year, as four or more digits with leading zeroes if required | -| `hh` | Hour, as two digits with leading zero if required | -| `mm` | Minute, as two digits with leading zero if required | -| `ss` | Seconds, as two digits with leading zero if required | - -### Aliasing - -JavaScript's `Date` API was inspired by Java's `java.util.Date` library (while the latter had become de facto legacy since Java 1.1 in 1997). In particular, the Java `Date` class had a method called `toGMTString` — which was poorly named, because the [Greenwich Mean Time](https://en.wikipedia.org/wiki/Greenwich_Mean_Time) is not equivalent to the [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time), while JavaScript dates always operate by UTC time. For web compatibility reasons, `toGMTString` remains as an alias to `toUTCString`, and they refer to the exact same function object. This means: - -```js -Date.prototype.toGMTString.name === "toUTCString"; -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/valueOf.mdx deleted file mode 100644 index e8bd638df9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Date/prototype/valueOf.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Date.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`Date` object. - - - -## Syntax - -```js -valueOf() -``` - -### Return value - -The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date, or [`NaN`](../../NaN.mdx) in case of an invalid date. - -## Description - -The `valueOf()` method returns the primitive value of a `Date` -object as a number data type, the number of milliseconds since midnight 01 January, 1970 -UTC. - -This method is functionally equivalent to the [`Date.prototype.getTime()`](./getTime.mdx) -method. - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DecompressionStream/DecompressionStream.mdx b/documentation/versioned_docs/version-3.9.0/globals/DecompressionStream/DecompressionStream.mdx deleted file mode 100644 index 8195ef01d3..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DecompressionStream/DecompressionStream.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream() - -The **`DecompressionStream()`** constructor creates a new `DecompressionStream` object which decompresses a stream of data. - -## Syntax - -```js -new DecompressionStream(format) -``` - -### Parameters - -- `format` - - - : One of the following compression formats: - - - `"gzip"` - - `"deflate"` - - `"deflate-raw"` - -## Exceptions - -- `TypeError` - - : Thrown if the format passed to the constructor is not supported. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DecompressionStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.9.0/globals/DecompressionStream/prototype/readable.mdx deleted file mode 100644 index 104213005d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DecompressionStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.readable - -The **`readable`** read-only property of the `DecompressionStream` interface returns a `ReadableStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/DecompressionStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.9.0/globals/DecompressionStream/prototype/writable.mdx deleted file mode 100644 index 90eea36e54..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/DecompressionStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# DecompressionStream.writable - -The **`writable`** read-only property of the `DecompressionStream` interface returns a `WritableStream`. - -## Value - -A `WritableStream` diff --git a/documentation/versioned_docs/version-3.9.0/globals/EcKeyImportParams/EcKeyImportParams.mdx b/documentation/versioned_docs/version-3.9.0/globals/EcKeyImportParams/EcKeyImportParams.mdx deleted file mode 100644 index ba566b82d2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/EcKeyImportParams/EcKeyImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EcKeyImportParams - -The **`EcKeyImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when generating any elliptic-curve-based key pair: that is, when the algorithm is identified as ECDSA. - -## Instance properties - -- `name` - - : A string. This should be set to `ECDSA`. -- `namedCurve` - - - : A string representing the name of the elliptic curve to use. This may be any of the following names for [NIST](https://www.nist.gov/)-approved curves: - - - `P-256` - - `P-384` - - `P-521` diff --git a/documentation/versioned_docs/version-3.9.0/globals/EcdsaParams/EcdsaParams.mdx b/documentation/versioned_docs/version-3.9.0/globals/EcdsaParams/EcdsaParams.mdx deleted file mode 100644 index 5594d480f9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/EcdsaParams/EcdsaParams.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# EcdsaParams - -The **`EcdsaParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.sign()` or `SubtleCrypto.verify()` when using the ECDSA algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `ECDSA`. -- `hash` - - - : A string. An identifier for the digest algorithm to use. This should be one of the following: - - - `SHA-256`: selects the SHA-256 algorithm. - - `SHA-384`: selects the SHA-384 algorithm. - - `SHA-512`: selects the SHA-512 algorithm. - - > **Warning:** `SHA-1` is also supported here but the SHA-1 algorithm is considered vulnerable and should no longer be used. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Error/Error.mdx b/documentation/versioned_docs/version-3.9.0/globals/Error/Error.mdx deleted file mode 100644 index 427380bf3e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Error/Error.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error - -The **`Error()`** constructor creates an error object. - -## Syntax - -```js -new Error() -new Error(message) -new Error(message, options) -new Error(message, fileName) -new Error(message, fileName, lineNumber) - -Error() -Error(message) -Error(message, options) -Error(message, fileName) -Error(message, fileName, lineNumber) -``` - -> **Note:** `Error()` can be called with or without `new`. Both create a new `Error` instance. - -### Parameters - -- `message` _**optional**_ - - : A human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A value indicating the specific cause of the error, reflected in the [`Error.prototype.cause`](./prototype/cause.mdx) property. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Error/prototype/cause.mdx b/documentation/versioned_docs/version-3.9.0/globals/Error/prototype/cause.mdx deleted file mode 100644 index 89ded66920..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Error/prototype/cause.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.cause - -The **`cause`** data property of an [`Error`](../../../globals/Error/Error.mdx) instance indicates the specific original cause of the error. - -It is used when catching and re-throwing an error with a more-specific or useful error message in order to still have access to the original error. - -## Value - -The value that was passed to the [`Error`](../Error.mdx) constructor in the `options.cause` argument. It may not be present. - -## Description - -The value of `cause` can be of any type. You should not make assumptions that the error you caught has an `Error` as its `cause`, in the same way that you cannot be sure the variable bound in the `catch` statement is an `Error` either. The "Providing structured data as the error cause" example below shows a case where a non-error is deliberately provided as the cause. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Error/prototype/message.mdx b/documentation/versioned_docs/version-3.9.0/globals/Error/prototype/message.mdx deleted file mode 100644 index 57040689de..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Error/prototype/message.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.message - -The **`message`** data property of an [`Error`](../Error.mdx) instance is a human-readable description of the error. - -## Value - -A string corresponding to the value passed to the [`Error`](../Error.mdx) constructor as the first argument. - -## Description - -This property contains a brief description of the error if one is available or has been set. The `message` property combined with the [`name`](./name.mdx) property is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the Error. - -By default, the `message` property is an empty string, but this behavior can be overridden for an instance by specifying a message as the first argument to the [`Error`](../Error.mdx) constructor. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Error/prototype/name.mdx b/documentation/versioned_docs/version-3.9.0/globals/Error/prototype/name.mdx deleted file mode 100644 index b12512f83e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Error/prototype/name.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.name - -The **`name`** data property of `Error.prototype` is shared by all [`Error`](../Error.mdx) instances. It represents the name for the type of error. For `Error.prototype.name`, the initial value is `"Error"`. Subclasses like [`TypeError`](../../../globals/TypeError/TypeError.mdx) and [`SyntaxError`](../../SyntaxError/SyntaxError.mdx) provide their own `name` properties. - -## Value - -A string. For `Error.prototype.name`, the initial value is `"Error"`. - -## Description - -By default, [`Error`](../Error.mdx) instances are given the name "Error". The `name` property, in addition to the [`message`](./message.mdx) property, is used by the [`Error.prototype.toString()`](./toString.mdx) method to create a string representation of the error. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Error/prototype/toString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Error/prototype/toString.mdx deleted file mode 100644 index 2435b40b92..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Error/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Error.prototype.toString() - -The **`toString()`** method returns a string representing the -specified [`Error`](../Error.mdx) object. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified [`Error`](../Error.mdx) object. - -## Description - -The [`Error`](../Error.mdx) object overrides the [`Object.prototype.toString()`](../../Object/prototype/toString.mdx) -method inherited by all objects. diff --git a/documentation/versioned_docs/version-3.9.0/globals/EvalError/EvalError.mdx b/documentation/versioned_docs/version-3.9.0/globals/EvalError/EvalError.mdx deleted file mode 100644 index 47c459f170..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/EvalError/EvalError.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# EvalError - -The **`EvalError()`** constructor creates a new `EvalError` instance. - -## Syntax - -```js -new EvalError() -new EvalError(message) -new EvalError(message, options) -new EvalError(message, fileName) -new EvalError(message, fileName, lineNumber) - -EvalError() -EvalError(message) -EvalError(message, options) -EvalError(message, fileName) -EvalError(message, fileName, lineNumber) -``` - -> **Note:** `EvalError()` can be called with or without `new`. Both create a new `EvalError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.9.0/globals/FetchEvent/FetchEvent.mdx b/documentation/versioned_docs/version-3.9.0/globals/FetchEvent/FetchEvent.mdx deleted file mode 100644 index 6cd2c5ec1d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/FetchEvent/FetchEvent.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent - -This is the event type for `fetch` events. It contains information about the fetch, including the request and how the receiver will treat the response. -It provides the [`event.respondWith()`](./prototype/respondWith.mdx) method, which allows us to provide a response to this fetch. - -## Instance properties - -- `FetchEvent.request` _**readonly**_ - - : The `Request` that was received by the application. -- `FetchEvent.client` _**readonly**_ - - : Information about the downstream client that made the request. - - `FetchEvent.client.address` _**readonly**_ - - : A string representation of the IPv4 or IPv6 address of the downstream client. - - `FetchEvent.client.geo` _**readonly**_ - - : A [geolocation dictionary](../../fastly:geolocation/getGeolocationForIpAddress.mdx) corresponding to the IP address of the downstream client. - - `FetchEvent.client.tlsJA3MD5` _**readonly**_ - - : A string representation of the JA3 hash of the TLS ClientHello message. - - `FetchEvent.client.tlsCipherOpensslName` _**readonly**_ - - : A string representation of the cipher suite used to secure the client TLS connection. - - `FetchEvent.client.tlsProtocol` _**readonly**_ - - : A string representation of the TLS protocol version used to secure the client TLS connection. - - `FetchEvent.client.tlsClientCertificate` _**readonly**_ - - : An ArrayBuffer containing the raw client certificate in the mutual TLS handshake message. It is in PEM format. Returns an empty ArrayBuffer if this is not mTLS or available. - - `FetchEvent.client.tlsClientHello` _**readonly**_ - - : An ArrayBuffer containing the raw bytes sent by the client in the TLS ClientHello message. - -## Instance methods - -- [`FetchEvent.respondWith()`](./prototype/respondWith.mdx) - - : Provide (a promise for) a response for this request. -- [`FetchEvent.waitUntil()`](./prototype/waitUntil.mdx) - - : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching. diff --git a/documentation/versioned_docs/version-3.9.0/globals/FetchEvent/prototype/respondWith.mdx b/documentation/versioned_docs/version-3.9.0/globals/FetchEvent/prototype/respondWith.mdx deleted file mode 100644 index 4697c12843..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/FetchEvent/prototype/respondWith.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.respondWith() - -The **`respondWith()`** method allows you to provide a promise for a [`Response`](../../Response/Response.mdx) to send back to the client which made the incoming request to your application. - -## Syntax - -```js -respondWith(response) -``` - -### Parameters - -- `response` - - : A [`Response`](../../Response/Response.mdx) or a [`Promise`](../../Promise/Promise.mdx) that resolves to a - [`Response`](../../Response/Response.mdx). Otherwise, a network error is returned to Fetch. - -### Return value - -Always returns `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/FetchEvent/prototype/waitUntil.mdx b/documentation/versioned_docs/version-3.9.0/globals/FetchEvent/prototype/waitUntil.mdx deleted file mode 100644 index 79b4af49c8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/FetchEvent/prototype/waitUntil.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FetchEvent.waitUntil() - - -The **`waitUntil()`** method tells the host environment that work is ongoing until the promise settles, and it shouldn't terminate -the application if it wants that work to complete. - -The `waitUntil()` method must be initially called synchronously within the event callback, -but after that it can be called multiple times, and will hold the process open until all the promises passed to it -settle. - -## Syntax - -```js -waitUntil(promise) -``` - -### Parameters - -A [`Promise`](../../Promise/Promise.mdx). - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/FinalizationRegistry/FinalizationRegistry.mdx b/documentation/versioned_docs/version-3.9.0/globals/FinalizationRegistry/FinalizationRegistry.mdx deleted file mode 100644 index a58418a70a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/FinalizationRegistry/FinalizationRegistry.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry() - -The **`FinalizationRegistry`** constructor creates a `FinalizationRegistry` object that uses the given callback. - -## Syntax - -```js -// Arrow callback function -new FinalizationRegistry((heldValue) => { /* … */ }) - -// Callback function -new FinalizationRegistry(callbackFn) - -// Inline callback function -new FinalizationRegistry(function(heldValue) { /* … */ }) -``` - -> **Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `callback` - - : The callback function this registry should use. diff --git a/documentation/versioned_docs/version-3.9.0/globals/FinalizationRegistry/prototype/register.mdx b/documentation/versioned_docs/version-3.9.0/globals/FinalizationRegistry/prototype/register.mdx deleted file mode 100644 index dcb476af8f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/FinalizationRegistry/prototype/register.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.register() - -The `register()` method registers an object with a -`FinalizationRegistry` instance so that if the object is garbage-collected, -the registry's callback may get called. - -## Syntax - -```js -register(target, heldValue) -register(target, heldValue, unregisterToken) -``` - -### Parameters - -- `target` - - : The target object to register. -- `heldValue` - - : The value to pass to the finalizer for this object. This cannot be the `target` object but can be anything else, including functions and primitives. -- `unregisterToken` _**optional**_ - - : A token that may be used with the `unregister` method later to unregister - the target object. If provided (and not `undefined`), this must be an - object. If not provided, the target cannot be unregistered. - -### Return value - -`undefined`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when one of the following condition is met: - - `target` is not an object (object as opposed to primitives; functions are objects as well) - - `target` is the same as `heldvalue` (`target === heldValue`) - - `unregisterToken` is not an object - -## Description - -See the [Avoid where possible](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#avoid_where_possible) -and [Notes on cleanup callbacks](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry#notes_on_cleanup_callbacks) -sections of the `FinalizationRegistry` page for important caveats. diff --git a/documentation/versioned_docs/version-3.9.0/globals/FinalizationRegistry/prototype/unregister.mdx b/documentation/versioned_docs/version-3.9.0/globals/FinalizationRegistry/prototype/unregister.mdx deleted file mode 100644 index fe3ca565b8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/FinalizationRegistry/prototype/unregister.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# FinalizationRegistry.prototype.unregister() - -The `unregister()` method unregisters a target object from a -`FinalizationRegistry` instance. - -## Syntax - -```js -unregister(unregisterToken) -``` - -### Parameters - -- `unregisterToken` - - : The token used with the [`FinalizationRegistry.prototype.register`](./register.mdx) method when registering the target object. Multiple cells registered with the same `unregisterToken` will be unregistered together. - -### Return value - -A boolean value that is `true` if at least one cell was unregistered and `false` if no cell was unregistered. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown when `unregisterToken` is not an object. - -## Description - -When a target object has been reclaimed, it is no longer registered in the registry. -There is no need to call `unregister` in your cleanup callback. Only call -`unregister` if you haven't received a cleanup callback and no longer need -to receive one. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Float32Array/Float32Array.mdx b/documentation/versioned_docs/version-3.9.0/globals/Float32Array/Float32Array.mdx deleted file mode 100644 index d776f9f448..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Float32Array/Float32Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float32Array() - -The **`Float32Array()`** typed array constructor creates a new -`Float32Array` object, which is, an array of 32-bit floating point numbers -(corresponding to the C `float` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float32Array() -new Float32Array(length) -new Float32Array(typedArray) -new Float32Array(object) - -new Float32Array(buffer) -new Float32Array(buffer, byteOffset) -new Float32Array(buffer, byteOffset, length) -``` - -> **Note:** `Float32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Float64Array/Float64Array.mdx b/documentation/versioned_docs/version-3.9.0/globals/Float64Array/Float64Array.mdx deleted file mode 100644 index b31731985c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Float64Array/Float64Array.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Float64Array() - -The **`Float64Array()`** typed array constructor creates a new -`Float64Array` object, which is, an array of 64-bit floating point numbers -(corresponding to the C `double` data type) in the platform byte order. If -control over byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are -initialized to `0`. Once established, you can reference elements in the array -using the object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Float64Array() -new Float64Array(length) -new Float64Array(typedArray) -new Float64Array(object) - -new Float64Array(buffer) -new Float64Array(buffer, byteOffset) -new Float64Array(buffer, byteOffset, length) -``` - -> **Note:** `Float64Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Function/Function.mdx b/documentation/versioned_docs/version-3.9.0/globals/Function/Function.mdx deleted file mode 100644 index 78d41ae9be..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Function/Function.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function() - -The **`Function()`** constructor creates a new [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues as `eval()`. However, unlike `eval` (which may have access to the local scope), the `Function` constructor creates functions which execute in the global scope only. - - - -## Syntax - -```js -new Function(functionBody) -new Function(arg0, functionBody) -new Function(arg0, arg1, functionBody) -new Function(arg0, arg1, /* … ,*/ argN, functionBody) - -Function(functionBody) -Function(arg0, functionBody) -Function(arg0, arg1, functionBody) -Function(arg0, arg1, /* … ,*/ argN, functionBody) -``` - -> **Note:** `Function()` can be called with or without `new`. Both create a new `Function` instance. - -### Parameters - -- `argN` _**optional**_ - - - : Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript parameter (any of plain [identifier](https://developer.mozilla.org/docs/Glossary/Identifier), [rest parameter](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/rest_parameters), or [destructured](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) parameter, optionally with a [default](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters)), or a list of such strings separated with commas. - - As the parameters are parsed in the same way as function expressions, whitespace and comments are accepted. For example: `"x", "theValue = 42", "[a, b] /* numbers */"` — or `"x, theValue = 42, [a, b] /* numbers */"`. (`"x, theValue = 42", "[a, b]"` is also correct, though very confusing to read.) - -- `functionBody` - - : A string containing the JavaScript statements comprising the function definition. - -## Description - -`Function` objects created with the `Function` constructor are parsed when the function is created. This is less efficient than creating a function with a [function expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function) or [function declaration](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) and calling it within your code, because such functions are parsed with the rest of the code. - -All arguments passed to the function, except the last, are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed. The function will be dynamically compiled as a function expression, with the source assembled in the following fashion: - -```js -`function anonymous(${args.join(",")} -) { -${functionBody} -}` -``` - -This is observable by calling the function's [`toString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) method. - -However, unlike normal [function expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function), the name `anonymous` is not added to the `functionBody`'s scope, since `functionBody` only has access the global scope. If `functionBody` is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode) (the body itself needs to have the `"use strict"` directive since it doesn't inherit the strictness from the context), you may use [`arguments.callee`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments/callee) to refer to the function itself. Alternatively, you can define the recursive part as an inner function: - -```js -const recursiveFn = new Function("count", ` -(function recursiveFn(count) { - if (count < 0) { - return; - } - console.log(count); - recursiveFn(count - 1); -})(count); -`); -``` - -Note that the two dynamic parts of the assembled source — the parameters list `args.join(",")` and `functionBody` — will first be parsed separately to ensure they are each syntactically valid. This prevents injection-like attempts. - -```js -new Function("/*", "*/) {"); -// SyntaxError: Unexpected end of arg string -// Doesn't become "function anonymous(/*) {*/) {}" -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/apply.mdx b/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/apply.mdx deleted file mode 100644 index 7684098326..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/apply.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.apply() - -The **`apply()`** method calls the specified function with a given `this` value, and `arguments` provided as an array (or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - - - -## Syntax - -```js -apply(thisArg) -apply(thisArg, argsArray) -``` - -### Parameters - -- `thisArg` - - : The value of `this` provided for the call to `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `argsArray` _**optional**_ - - : An array-like object, specifying the arguments with which `func` should be called, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx) if no arguments should be provided to the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `apply()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `apply()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/bind.mdx b/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/bind.mdx deleted file mode 100644 index f4236e916c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/bind.mdx +++ /dev/null @@ -1,87 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.bind() - -The **`bind()`** method creates a new function that, when called, has its `this` keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. - - - -## Syntax - -```js -bind(thisArg) -bind(thisArg, arg1) -bind(thisArg, arg1, arg2) -bind(thisArg, arg1, arg2, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to be passed as the `this` parameter to the target function `func` when the bound function is called. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. The value is ignored if the bound function is constructed using the `new` operator. -- `arg1, …, argN` _**optional**_ - - : Arguments to prepend to arguments provided to the bound function when invoking `func`. - -### Return value - -A copy of the given function with the specified `this` value, and initial arguments (if provided). - -## Description - -The `bind()` function creates a new _bound function_. Calling the bound function generally results in the execution of the function it wraps, which is also called the _target function_. The bound function will store the parameters passed — which include the value of `this` and the first few arguments — as its internal state. These values are stored in advance, instead of being passed at call time. You can generally see `const boundFn = fn.bind(thisArg, arg1, arg2)` as being equivalent to `const boundFn = (...restArgs) => fn.call(thisArg, arg1, arg2, ...restArgs)` for the effect when it's called (but not when `boundFn` is constructed). - -A bound function can be further bound by calling `boundFn.bind(thisArg, /* more args */)`, which creates another bound function `boundFn2`. The newly bound `thisArg` value is ignored, because the target function of `boundFn2`, which is `boundFn`, already has a bound `this`. When `boundFn2` is called, it would call `boundFn`, which in turn calls `fn`. The arguments that `fn` ultimately receives are, in order: the arguments bound by `boundFn`, arguments bound by `boundFn2`, and the arguments received by `boundFn2`. - -```js -"use strict"; // prevent `this` from being boxed into the wrapper object - -function log(...args) { - console.log(this, ...args); -} -const boundLog = log.bind("this value", 1, 2); -const boundLog2 = boundLog.bind("new this value", 3, 4); -boundLog2(5, 6); // "this value", 1, 2, 3, 4, 5, 6 -``` - -A bound function may also be constructed using the `new` operator if its target function is constructable. Doing so acts as though the target function had instead been constructed. The prepended arguments are provided to the target function as usual, while the provided `this` value is ignored (because construction prepares its own `this`, as seen by the parameters of [`Reflect.construct`](../../../globals/Reflect/construct.mdx)). If the bound function is directly constructed, [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) will be the target function instead. (That is, the bound function is transparent to `new.target`.) - -```js -class Base { - constructor(...args) { - console.log(new.target === Base); - console.log(args); - } -} - -const BoundBase = Base.bind(null, 1, 2); - -new BoundBase(3, 4); // true, [1, 2, 3, 4] -``` - -However, because a bound function does not have the [`prototype`](../../../globals/Function/prototype/) property, it cannot be used as a base class for [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends). - -```js example-bad -class Derived extends class {}.bind(null) {} -// TypeError: Class extends value does not have valid prototype property undefined -``` - -When using a bound function as the right-hand side of [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof), `instanceof` would reach for the target function (which is stored internally in the bound function) and read its `prototype` instead. - -```js -class Base {} -const BoundBase = Base.bind(null, 1, 2); -console.log(new Base() instanceof BoundBase); // true -``` - -The bound function has the following properties: - -- [`length`](../../../globals/Function/prototype/length.mdx) - - : The `length` of the target function minus the number of arguments being bound (not counting the `thisArg` parameter), with 0 being the minimum value. -- [`name`](../../../globals/Function/prototype/name.mdx) - - : The `name` of the target function plus a `"bound "` prefix. - -The bound function also inherits the [prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) of the target function. However, it doesn't have other own properties of the target function (such as [static properties](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) if the target function is a class). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/call.mdx b/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/call.mdx deleted file mode 100644 index 0fc144d942..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/call.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.call() - -The **`call()`** method calls the function with a given `this` value and arguments provided individually. - -## Syntax - -```js -call(thisArg) -call(thisArg, arg1) -call(thisArg, arg1, /* …, */ argN) -``` - -### Parameters - -- `thisArg` - - : The value to use as `this` when calling `func`. If the function is not in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) will be replaced with the global object, and primitive values will be converted to objects. -- `arg1, …, argN` _**optional**_ - - : Arguments for the function. - -### Return value - -The result of calling the function with the specified `this` value and arguments. - -## Description - -> **Note:** This function is almost identical to [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx), except that `call()` accepts an **argument list**, while `apply()` accepts a **single array of arguments** — for example, `func.apply(this, ['eat', 'bananas'])` vs. `func.call(this, 'eat', 'bananas')`. - -Normally, when calling a function, the value of [`this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this) inside the function is the object that the function was accessed on. With `call()`, you can assign an arbitrary value as `this` when calling an existing function, without first attaching the function to the object as a property. This allows you to use methods of one object as generic utility functions. - -> **Warning:** Do not use `call()` to chain constructors (for example, to implement inheritance). This invokes the constructor function as a plain function, which means [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) is `undefined`, and classes throw an error because they can't be called without `new`. Use [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) or [`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) instead. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/index.mdx b/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/index.mdx deleted file mode 100644 index beb35c2184..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/index.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.prototype - -The **`prototype`** data property of a `Function` instance is used when the function is used as a constructor with the `new` operator. It will become the new object's prototype. - -> **Note:** Not all `Function` objects have the `prototype` property — see [description](#description). - -## Value - -An object. - -> **Note:** The `prototype` property of [classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes) is not writable. - -## Description - -When a function is called with `new`, the constructor's `prototype` property will become the resulting object's prototype. - -```js -function Ctor() {} -const inst = new Ctor(); -console.log(Object.getPrototypeOf(inst) === Ctor.prototype); // true -``` - -You can read [Inheritance and the prototype chain](https://developer.mozilla.org/docs/Web/JavaScript/Inheritance_and_the_prototype_chain#constructors) for more information about the interactions between a constructor function's `prototype` property and the resulting object's prototype. - -A function having a `prototype` property is not sufficient for it to be eligible as a constructor. [Generator functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*) have a `prototype` property, but cannot be called with `new`: - -```js -async function* asyncGeneratorFunction() {} -function* generatorFunction() {} -``` - -Instead, generator functions' `prototype` property is used when they are called _without_ `new`. The `prototype` property will become the returned [`Generator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator) object's prototype. - -In addition, some functions may have a `prototype` but throw unconditionally when called with `new`. For example, the [`Symbol()`](../../../globals/Symbol/Symbol.mdx) and [`BigInt`](../../../globals/BigInt/BigInt.mdx) functions throw when called with `new`, because `Symbol.prototype` and `BigInt.prototype` are only intended to provide methods for the primitive values, but the wrapper objects should not be directly constructed. - -The following functions do not have `prototype`, and are therefore ineligible as constructors, even if a `prototype` property is later manually assigned: - -```js -const method = { foo() {} }.foo; -const arrowFunction = () => {}; -async function asyncFunction() {} -``` - -The following are valid constructors that have `prototype`: - -```js -class Class {} -function fn() {} -``` - -A [bound function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind) does not have a `prototype` property, but may be constructable. When it's constructed, the target function is constructed instead, and if the target function is constructable, it would return a normal instance. - -```js -const boundFunction = function () {}.bind(null); -``` - -A function's `prototype` property, by default, is a plain object with one property: (`constructor`)[../../../globals/Object/prototype/constructor.mdx), which is a reference to the function itself. The `constructor` property is writable, non-enumerable, and configurable. - -If the `prototype` of a function is reassigned with something other than an `Object`, when the function is called with `new`, the returned object's prototype would be `Object.prototype` instead. (In other words, `new` ignores the `prototype` property and constructs a plain object.) - -```js -function Ctor() {} -Ctor.prototype = 3; -console.log(Object.getPrototypeOf(new Ctor()) === Object.prototype); // true -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/length.mdx b/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/length.mdx deleted file mode 100644 index bb38496519..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/length.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.length - -The **`length`** data property of a `Function` instance indicates the number of parameters expected by the function. - -## Value - -A number. - -## Description - -A `Function` object's `length` property indicates how many arguments the function expects, i.e. the number of formal parameters. - -The `Function` constructor is itself a `Function` object. Its `length` data property has a value of `1`. - -Due to historical reasons, `Function.prototype` is a callable itself. The `length` property of `Function.prototype` has a value of `0`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/name.mdx b/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/name.mdx deleted file mode 100644 index 3f99cc3731..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/name.mdx +++ /dev/null @@ -1,214 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.name - -The **`name`** property of a `Function` instance indicates the function's name as specified when it was created, or it may be either `anonymous` or `''` (an empty string) for functions created anonymously. - -## Value - -A string. - -> **Note:** In non-standard, pre-ES2015 implementations the `configurable` attribute was `false` as well. - -## Description - -The function's `name` property can be used to identify the function in debugging tools or error messages. It has no semantic significance to the language itself. - -The `name` property is read-only and cannot be changed by the assignment operator: - -```js -function someFunction() {} - -someFunction.name = 'otherFunction'; -console.log(someFunction.name); // someFunction -``` - -To change it, use [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -The `name` property is typically inferred from how the function is defined. In the following sections, we will describe the various ways in which it can be inferred. - -### Function declaration - -The `name` property returns the name of a function declaration. - -```js -function doSomething() {} -doSomething.name; // "doSomething" -``` - -### Default-exported function declaration - -An [`export default`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/export) declaration exports the function as a declaration instead of an expression. If the declaration is anonymous, the name is `"default"`. - -```js -// -- someModule.js -- -export default function () {}; - -// -- main.js -- -import someModule from "./someModule.js"; - -someModule.name; // "default" -``` - -### Function constructor - -Functions created with the [`Function()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/Function) constructor have name "anonymous". - -```js -new Function().name; // "anonymous" -``` - -### Function expression - -If the function expression is named, that name is used as the `name` property. - -```js -const someFunction = function someFunctionName() {}; -someFunction.name; // "someFunctionName" -``` - -Anonymous function expressions created using the keyword `function` or arrow functions would have `""` (an empty string) as their name. - -```js -(function () {}).name; // "" -(() => {}).name; // "" -``` - -However, such cases are rare — usually, in order to refer to the expression elsewhere, the function expression is attached to an identifier when it's created (such as in a variable declaration). In such cases, the name can be inferred, as the following few subsections demonstrate. - -One practical case where the name cannot be inferred is a function returned from another function: - -```js -function getFoo() { - return () => {}; -} -getFoo().name; // "" -``` - -### Variable declaration and method - -Variables and methods can infer the name of an anonymous function from its syntactic position. - -```js -const f = function () {}; -const object = { - someMethod: function () {} -}; - -console.log(f.name); // "f" -console.log(object.someMethod.name); // "someMethod" -``` - -The same applies to assignment: - -```js -let f; -f = () => {}; -f.name; // "f" -``` - -### Initializer and default value - -Functions in initializers (default values) of [destructuring](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value), [default parameters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Default_parameters), [class fields](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Public_class_fields), etc., will inherit the name of the bound identifier as their `name`. - -```js -const [f = () => {}] = []; -f.name; // "f" - -const { someMethod: m = () => {} } = {}; -m.name; // "m" - -function foo(f = () => {}) { - console.log(f.name); -} -foo(); // "f" - -class Foo { - static someMethod = () => {}; -} -Foo.someMethod.name; // someMethod -``` - -### Shorthand method - -```js -const o = { - foo() {}, -}; -o.foo.name; // "foo"; -``` - -### Bound function - -[`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx) produces a function whose name is "bound " plus the function name. - -```js -function foo() {}; -foo.bind({}).name; // "bound foo" -``` - -### Getter and setter - -When using [`get`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [`set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set) accessor properties, "get" or "set" will appear in the function name. - -```js -const o = { - get foo() {}, - set foo(x) {}, -}; - -const descriptor = Object.getOwnPropertyDescriptor(o, "foo"); -descriptor.get.name; // "get foo" -descriptor.set.name; // "set foo"; -``` - -### Class - -A class's name follows the same algorithm as function declarations and expressions. - -```js -class Foo {} -Foo.name; // "Foo" -``` - -> **Warning:** JavaScript will set the function's `name` property only if a function does not have an own property called `name`. However, classes' [static members](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/static) will be set as own properties of the class constructor function, and thus prevent the built-in `name` from being applied. See [an example](#telling_the_constructor_name_of_an_object) below. - -### Symbol as function name - -If a `Symbol` is used a function name and the symbol has a description, the method's name is the description in square brackets. - -```js -const sym1 = Symbol("foo"); -const sym2 = Symbol(); - -const o = { - [sym1]() {}, - [sym2]() {}, -}; - -o[sym1].name; // "[foo]" -o[sym2].name; // "[]" -``` - -### Private property - -Private fields and private methods have the hash (`#`) as part of their names. - -```js -class Foo { - #field = () => {}; - #method() {} - getNames() { - console.log(this.#field.name); - console.log(this.#method.name); - } -} - -new Foo().getNames(); -// "#field" -// "#method" -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/toString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/toString.mdx deleted file mode 100644 index c2b4572389..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Function/prototype/toString.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Function.prototype.toString() - -The **`toString()`** method returns a string representing the source code of the specified `Function`. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the source code of the function. - -## Description - -The `Function` object overrides the `toString()` method -inherited from `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For user-defined `Function` -objects, the `toString` method returns a string containing the source text -segment which was used to define the function. - -JavaScript calls the `toString` method automatically when a -`Function` is to be represented as a text value, e.g. when a function is -concatenated with a string. - -The `toString()` method will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception -("Function.prototype.toString called on incompatible object"), if its -`this` value object is not a `Function` object. - -```js example-bad -Function.prototype.toString.call('foo'); // throws TypeError -``` - -If the `toString()` method is called on built-in function objects, a -function created by [`Function.prototype.bind()`](../../../globals/Function/prototype/bind.mdx), or -other non-JavaScript functions, then `toString()` returns a -_native function string_ which looks like - -```js -"function someName() { [native code] }" -``` - -For intrinsic object methods and functions, `someName` is the initial name of the function; otherwise its content may be implementation-defined, but will always be in property name syntax, like `[1 + 1]`, `someName`, or `1`. - -> **Note:** This means using [`eval()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/eval) on native function strings is a guaranteed syntax error. - -If the `toString()` method is called on a function created by the `Function` constructor, `toString()` returns the source code of a synthesized function declaration named "anonymous" using the provided parameters and function body. For example, `Function("a", "b", "return a + b").toString()` will return: - -```js -"function anonymous(a,b\n) {\nreturn a + b\n}" -``` - -Since ES2018, the spec requires the return value of `toString()` to be the exact same source code as it was declared, including any whitespace and/or comments — or, if the host doesn't have the source code available for some reason, requires returning a native function string. Support for this revised behavior can be found in the [compatibility table](#browser_compatibility). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Headers/Headers.mdx b/documentation/versioned_docs/version-3.9.0/globals/Headers/Headers.mdx deleted file mode 100644 index c1041a833e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Headers/Headers.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers() - -The **`Headers()`** constructor creates a new `Headers` object. - -## Syntax - -```js -new Headers() -new Headers(init) -``` - -### Parameters - -- `init` _**optional**_ - - : An object containing any HTTP headers that you want to pre-populate your `Headers` object with. This can be a - simple object literal with `String` values, an array of name-value pairs, where each pair is a 2-element string array; or an existing - `Headers` object. In the last case, the new `Headers` object - copies its data from the existing `Headers` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/append.mdx b/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/append.mdx deleted file mode 100644 index 07dd5dd31f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/append.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.append() - -The **`append()`** method of the `Headers` -interface appends a new value onto an existing header inside a `Headers` -object, or adds the header if it does not already exist. - -The difference between `Headers.prototype.set()` and `append()` is -that if the specified header already exists and accepts multiple values, -`set()` will overwrite the existing value with the new one, whereas -`append()` will append the new value onto the end of the set of values. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to add to the `Headers` object. -- `value` - - : The value of the HTTP header you want to add. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/delete.mdx b/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/delete.mdx deleted file mode 100644 index 9ced8efa0b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/delete.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.delete() - -The **`delete()`** method of the `Headers` -interface deletes a header from the current `Headers` object. - -This method throws a `TypeError` for the following reasons: - -- The value of the name parameter is not the name of an HTTP header. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to delete from the `Headers` object. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/entries.mdx b/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/entries.mdx deleted file mode 100644 index 162bee914f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.entries() - -The **`Headers.entries()`** method returns an iterator allowing to go through all key/value pairs -contained in this object. The both the key and value of each pairs are `String` objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/forEach.mdx b/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/forEach.mdx deleted file mode 100644 index 198a765361..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/forEach.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.forEach() - -The **`Headers.forEach()`** method executes a callback function once per each key/value pair in the `Headers` object. - -## Syntax - -```js -// Arrow function -forEach((value, key) => { /* … */ }) -forEach((value, key, object) => { /* … */ }) - -// Inline callback function -forEach(function (value, key) { /* … */ }) -forEach(function (value, key, object) { /* … */ }) -forEach(function (value, key) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following arguments: - - `value` - - : Value of the currently visited header entry. - - `key` - - : Name of the currently visited header entry. - - `object` - - : The Headers object being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -`undefined`. - -## Description - -The `Headers.forEach()` method executes the provided callback once for each key of the Headers which actually exist. It is not invoked for keys which have been deleted. However, it is executed for keys which are present but have the value undefined. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/get.mdx b/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/get.mdx deleted file mode 100644 index 69def6a357..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/get.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.get() - -The **`get()`** method of the [`Headers`](../../../globals/Headers/Headers.mdx) interface -returns a byte string of all the values of a header within a `Headers` object -with a given name. If the requested header doesn't exist in the `Headers` -object, it returns `null`. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header whose values you want to retrieve from the - `Headers` object. If the given name is not the name of an HTTP header, this - method throws a `TypeError`. The name is case-insensitive. - -### Return value - -A [`String`](../../../globals/String/String.mdx) sequence representing the values of the retrieved header or -`null` if this header is not set. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/has.mdx b/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/has.mdx deleted file mode 100644 index bd3436cd88..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.has() - -The **`has()`** method of the `Headers` interface -returns a boolean stating whether a `Headers` object contains a certain -header. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to test for. If the given name is not a valid - HTTP header name, this method throws a `TypeError`. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/keys.mdx b/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/keys.mdx deleted file mode 100644 index 8e6e4ed4ad..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/keys.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.keys() - -The **`Headers.keys()`** method returns an iterator allowing to go through all keys contained -in this object. The keys are `String` objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/set.mdx b/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/set.mdx deleted file mode 100644 index 792a7b3127..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.set() - -The **`set()`** method of the `Headers` interface -sets a new value for an existing header inside a `Headers` object, or adds -the header if it does not already exist. - -The difference between `set()` and `Headers.append` is that if -the specified header already exists and accepts multiple values, `set()` -overwrites the existing value with the new one, whereas `Headers.append` -appends the new value to the end of the set of values. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the HTTP header you want to set to a new value. If the given name is not - the name of an HTTP header, this method throws a `TypeError`. -- `value` - - : The new value you want to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/values.mdx b/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/values.mdx deleted file mode 100644 index 149f446f5c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Headers/prototype/values.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Headers.values() - -The **`Headers.values()`** method returns an iterator allowing to go through all values contained -in this object. The values are `String` objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.9.0/globals/HmacImportParams/HmacImportParams.mdx b/documentation/versioned_docs/version-3.9.0/globals/HmacImportParams/HmacImportParams.mdx deleted file mode 100644 index 816aa2e7dc..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/HmacImportParams/HmacImportParams.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# HmacImportParams - -The **`HmacImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey`, when generating a key for the `HMAC` algorithm. - -## Instance properties - -- `name` - - : A string. This should be set to `HMAC`. -- `hash` - - - : A string representing the name of the digest function to use. The can take a value of `SHA-1`, `SHA-256`, `SHA-384`, or `SHA-512`. - -- `length` _optional_ - - : A `Number` representing the length in bits of the key. If this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. Unless you have a good reason to use a different length, omit this property and use the default. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/Infinity.mdx b/documentation/versioned_docs/version-3.9.0/globals/Infinity.mdx deleted file mode 100644 index 9e0ebda58d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Infinity.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Infinity - -The global property **`Infinity`** is a numeric value representing infinity. - -## Value - -The same number value as `Number.POSITIVE_INFINITY`. - -## Description - -`Infinity` is a property of the _global object_. In other words, it is a variable in global scope. - -The value `Infinity` (positive infinity) is greater than any other number. - -This value behaves slightly differently than mathematical infinity; see `Number.POSITIVE_INFINITY` for details. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Int16Array/Int16Array.mdx b/documentation/versioned_docs/version-3.9.0/globals/Int16Array/Int16Array.mdx deleted file mode 100644 index 6da6f8fc85..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Int16Array/Int16Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int16Array() - -The **`Int16Array()`** typed array constructor creates an array -of twos-complement 16-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int16Array() -new Int16Array(length) -new Int16Array(typedArray) -new Int16Array(object) - -new Int16Array(buffer) -new Int16Array(buffer, byteOffset) -new Int16Array(buffer, byteOffset, length) -``` - -> **Note:** `Int16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Int32Array/Int32Array.mdx b/documentation/versioned_docs/version-3.9.0/globals/Int32Array/Int32Array.mdx deleted file mode 100644 index d84839b895..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Int32Array/Int32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int32Array() - -The **`Int32Array()`** typed array constructor creates an array -of twos-complement 32-bit signed integers in the platform byte order. If control over -byte order is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized -to `0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Int32Array() -new Int32Array(length) -new Int32Array(typedArray) -new Int32Array(object) - -new Int32Array(buffer) -new Int32Array(buffer, byteOffset) -new Int32Array(buffer, byteOffset, length) -``` - -> **Note:** `Int32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Int8Array/Int8Array.mdx b/documentation/versioned_docs/version-3.9.0/globals/Int8Array/Int8Array.mdx deleted file mode 100644 index 1e33698ff7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Int8Array/Int8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Int8Array() - -The **`Int8Array()`** constructor creates a typed array of -twos-complement 8-bit signed integers. The contents are initialized to `0`. -Once established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Int8Array() -new Int8Array(length) -new Int8Array(typedArray) -new Int8Array(object) - -new Int8Array(buffer) -new Int8Array(buffer, byteOffset) -new Int8Array(buffer, byteOffset, length) -``` - -> **Note:** `Int8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.9.0/globals/JSON/parse.mdx b/documentation/versioned_docs/version-3.9.0/globals/JSON/parse.mdx deleted file mode 100644 index 0acca523ee..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/JSON/parse.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.parse() - -The **`JSON.parse()`** method parses a JSON string, constructing the JavaScript value or object described by the string. An optional _reviver_ function can be provided to perform a transformation on the resulting object before it is returned. - -## Syntax - -```js -JSON.parse(text) -JSON.parse(text, reviver) -``` - -### Parameters - -- `text` - - : The string to parse as JSON. -- `reviver` _**optional**_ - - : If a function, this prescribes how each value originally produced by parsing is transformed before being returned. Non-callable values are ignored. The function is called with the following arguments: - - `key` - - : The key associated with the value. - - `value` - - : The value produced by parsing. - -### Return value - -The `Object`, `Array`, string, number, boolean, or `null` value corresponding to the given JSON `text`. - -### Exceptions - -- [`SyntaxError`](../../globals/SyntaxError/SyntaxError.mdx) - - : Thrown if the string to parse is not valid JSON. - -## Description - -`JSON.parse()` parses a JSON string according to the [JSON grammar](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON#full_json_grammar), then evaluates the string as if it's a JavaScript expression. The only instance where a piece of JSON text represents a different value from the same JavaScript expression is when dealing with the `"__proto__"` key — see [Object literal syntax vs. JSON](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer#object_literal_syntax_vs._json). - -### The reviver parameter - -If a `reviver` is specified, the value computed by parsing is _transformed_ before being returned. Specifically, the computed value and all its properties (in a [depth-first](https://en.wikipedia.org/wiki/Depth-first_search) fashion, beginning with the most nested properties and proceeding to the original value itself) are individually run through the `reviver`. - -The `reviver` is called with the object containing the property being processed as `this`, and two arguments: `key` and `value`, representing the property name as a string (even for arrays) and the property value. If the `reviver` function returns [`undefined`](../../globals/undefined.mdx) (or returns no value — for example, if execution falls off the end of the function), the property is deleted from the object. Otherwise, the property is redefined to be the return value. If the `reviver` only transforms some values and not others, be certain to return all untransformed values as-is — otherwise, they will be deleted from the resulting object. - -Similar to the `replacer` parameter of [`JSON.stringify()`](../../globals/JSON/stringify.mdx), `reviver` will be last called on the root object with an empty string as the `key` and the root object as the `value`. For JSON text parsing to primitive values, `reviver` will be called once. - -Note that `reviver` is run after the value is parsed. So, for example, numbers in JSON text will have already been converted to JavaScript numbers, and may lose precision in the process. To transfer large numbers without loss of precision, serialize them as strings, and revive them to [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt), or other appropriate arbitrary precision formats. diff --git a/documentation/versioned_docs/version-3.9.0/globals/JSON/stringify.mdx b/documentation/versioned_docs/version-3.9.0/globals/JSON/stringify.mdx deleted file mode 100644 index 28f40f8c23..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/JSON/stringify.mdx +++ /dev/null @@ -1,96 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# JSON.stringify() - -The **`JSON.stringify()`** method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. - -## Syntax - -```js -JSON.stringify(value) -JSON.stringify(value, replacer) -JSON.stringify(value, replacer, space) -``` - -### Parameters - -- `value` - - : The value to convert to a JSON string. -- `replacer` _**optional**_ - - : A function that alters the behavior of the stringification process, or an array of strings or numbers naming properties of `value` that should be included in the output. If `replacer` is an array, all elements that are not strings or numbers (can be either primitives or wrapper objects), including `Symbol` values, are completely ignored. If `replacer` is anything other than a function or an array (e.g. [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided), all properties of the object are included in the resulting JSON string. -- `space` _**optional**_ - - - : A string or number that's used to insert white space (including indentation, line break characters, etc.) into the output JSON string for readability purposes. - - If this is a number, it indicates the number of space characters to be used as indentation, clamped to 10 (that is, any number greater than `10` is treated as if it were `10`). Values less than 1 indicate that no space should be used. - - If this is a string, the string (or the first 10 characters of the string, if it's longer than that) is inserted before every nested object or array. - - If `space` is anything other than a string or number (can be either a primitive or a wrapper object) — for example, is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or not provided — no white space is used. - -### Return value - -A JSON string representing the given value, or undefined. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following is true: - - `value` contains a circular reference. - - A `BigInt` value is encountered. - -## Description - -`JSON.stringify()` converts a value to JSON notation representing it: - -- `Boolean`, `Number`, `String`, and `BigInt` (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) objects are converted to the corresponding primitive values during stringification, in accordance with the traditional conversion semantics. `Symbol` objects (obtainable via [`Object()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/Object)) are treated as plain objects. -- Attempting to serialize `BigInt` values will throw. However, if the BigInt has a `toJSON()` method (through monkeypatching: `BigInt.prototype.toJSON = ...`), that method can provide the serialization result. This constraint ensures that a proper serialization (and, very likely, its accompanying deserialization) behavior is always explicitly provided by the user. -- [`undefined`](../../globals/undefined.mdx), `Function`, and `Symbol` values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) (when found in an array). `JSON.stringify()` can return `undefined` when passing in "pure" values like `JSON.stringify(() => {})` or `JSON.stringify(undefined)`. -- The numbers [`Infinity`](../../globals/Infinity.mdx) and [`NaN`](../../globals/NaN.mdx), as well as the value [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), are all considered `null`. (But unlike the values in the previous point, they would never be omitted.) -- Arrays are serialized as arrays (enclosed by square brackets). Only array indices between 0 and `length - 1` (inclusive) are serialized; other properties are ignored. -- For other objects: - - - All `Symbol`-keyed properties will be completely ignored, even when using the [`replacer`](#the_replacer_parameter) parameter. - - - If the value has a `toJSON()` method, it's responsible to define what data will be serialized. Instead of the object being serialized, the value returned by the `toJSON()` method when called will be serialized. `JSON.stringify()` calls `toJSON` with one parameter, the `key`, which has the same semantic as the `key` parameter of the [`replacer`](#the_replacer_parameter) function: - - - if this object is a property value, the property name - - if it is in an array, the index in the array, as a string - - if `JSON.stringify()` was directly called on this object, an empty string - - `Date` objects implement the [`toJSON()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON) method which returns a string (the same as [`date.toISOString()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)). Thus, they will be stringified as strings. - - - Only [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) are visited. This means [Map](../../globals/Map/Map.mdx), [Set](../../globals/Set/Set.mdx), etc. will become `"{}"`. You can use the [`replacer`](#the_replacer_parameter) parameter to serialize them to something more useful. - - Properties are visited using the same algorithm as [`Object.keys()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/keys), which has a well-defined order and is stable across implementations. For example, `JSON.stringify` on the same object will always produce the same string, and `JSON.parse(JSON.stringify(obj))` would produce an object with the same key ordering as the original (assuming the object is completely JSON-serializable). - -### The replacer parameter - -The `replacer` parameter can be either a function or an array. - -As an array, its elements indicate the names of the properties in the object that should be included in the resulting JSON string. Only string and number values are taken into account; symbol keys are ignored. - -As a function, it takes two parameters: the `key` and the `value` being stringified. The object in which the key was found is provided as the `replacer`'s `this` context. - -The `replacer` function is called for the initial object being stringified as well, in which case the `key` is an empty string (`""`). It is then called for each property on the object or array being stringified. Array indices will be provided in its string form as `key`. The current property value will be replaced with the `replacer`'s return value for stringification. This means: - -- If you return a number, string, boolean, or `null`, that value is directly serialized and used as the property's value. (Returning a BigInt will throw as well.) -- If you return a `Function`, `Symbol`, or [`undefined`](../../globals/undefined.mdx), the property is not included in the output. -- If you return any other object, the object is recursively stringified, calling the `replacer` function on each property. - -> **Note:** When parsing JSON generated with `replacer` functions, you would likely want to use the [`reviver`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#using_the_reviver_parameter) parameter to perform the reverse operation. - -Typically, array elements' index would never shift (even when the element is an invalid value like a function, it will become `null` instead of omitted). Using the `replacer` function allows you to control the order of the array elements by returning a different array. - -### The space parameter - -The `space` parameter may be used to control spacing in the final string. - -- If it is a number, successive levels in the stringification will each be indented by this many space characters. -- If it is a string, successive levels will be indented by this string. - -Each level of indentation will never be longer than 10. Number values of `space` are clamped to 10, and string values are truncated to 10 characters. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Map/@@species.mdx b/documentation/versioned_docs/version-3.9.0/globals/Map/@@species.mdx deleted file mode 100644 index f7617a7f76..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Map/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Map\[Symbol.species] - -The **`Map[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Map` objects. - -## Syntax - -```js -Map[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Map` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Map` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Map` methods. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Map/Map.mdx b/documentation/versioned_docs/version-3.9.0/globals/Map/Map.mdx deleted file mode 100644 index 3e7debd816..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Map/Map.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map() - -The **`Map()` constructor** creates [Map](../../globals/Map/Map.mdx) objects. - -## Syntax - -```js -new Map() -new Map(iterable) -``` - -> **Note:** `Map()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : An `Array` or other - [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) object - whose elements are key-value pairs. (For example, arrays with two elements, - such as `[[ 1, 'one' ],[ 2, 'two' ]]`.) Each key-value pair is added to the - new `Map`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/@@iterator.mdx deleted file mode 100644 index 336b32d519..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a `Map` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows maps to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the key-value pairs of the map. - -The initial value of this property is the same function object as the initial value of the [`Map.prototype.entries`](../../../globals/Map/prototype/entries.mdx) property. - -## Syntax - -```js -map[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Map.prototype.entries()`](../../../globals/Map/prototype/entries.mdx): a new iterable iterator object that yields the key-value pairs of the map. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/clear.mdx b/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/clear.mdx deleted file mode 100644 index d5adc7625a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/clear.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.clear() - -The **`clear()`** method removes all elements from a `Map` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/delete.mdx b/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/delete.mdx deleted file mode 100644 index 56bd947c11..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.delete() - -The **`delete()`** method removes the specified element from a `Map` object by -key. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `Map` object. - -### Return value - -`true` if an element in the `Map` object existed and has been removed, or -`false` if the element does not exist. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/entries.mdx b/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/entries.mdx deleted file mode 100644 index 46d9efb386..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/entries.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.entries() - -The **`entries()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the `[key, value]` pairs for each element in the `Map` object in -insertion order. In this particular case, this iterator object is also an -iterable, so the for-of loop can be used. When the protocol `[Symbol.iterator]` -is used, it returns a function that, when invoked, returns this iterator itself. - -## Syntax - -```js -entries() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/forEach.mdx b/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/forEach.mdx deleted file mode 100644 index 2cdf8024f1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/forEach.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.forEach() - -The **`forEach()`** method executes a provided function once per each key/value -pair in the `Map` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* … */ } ) -forEach((value) => { /* … */ } ) -forEach((value, key) => { /* … */ } ) -forEach((value, key, map) => { /* … */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* … */ }) -forEach(function(value) { /* … */ }) -forEach(function(value, key) { /* … */ }) -forEach(function(value, key, map) { /* … */ }) -forEach(function(value, key, map) { /* … */ }, thisArg) -``` - -### Parameters - -- `callbackFn` - - : Function to execute for each entry in the map. It takes the following - arguments: - - `value` _**optional**_ - - : Value of each iteration. - - `key` _**optional**_ - - : Key of each iteration. - - `map` _**optional**_ - - : The map being iterated. -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach` method executes the provided `callback` once for each key of the -map which actually exist. It is not invoked for keys which have been deleted. -However, it is executed for values which are present but have the value -`undefined`. - -`callback` is invoked with **three arguments**: - -- the entry's `value` -- the entry's `key` -- the **`Map` object** being traversed - -If a `thisArg` parameter is provided to `forEach`, it will be passed to -`callback` when invoked, for use as its `this` value. Otherwise, the value -`undefined` will be passed for use as its `this` value. The `this` value -ultimately observable by `callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added -before `forEach` has finished. `callback` is not invoked for values deleted -before being visited. New values added before `forEach` has finished will be -visited. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/get.mdx b/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/get.mdx deleted file mode 100644 index 1649763d9f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/get.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.get() - -The **`get()`** method returns a specified element from a `Map` object. If the -value that is associated to the provided key is an object, then you will get a -reference to that object and any change made to that object will effectively -modify it inside the `Map` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : The key of the element to return from the `Map` object. - -### Return value - -The element associated with the specified key, or -[`undefined`](../../../globals/undefined.mdx) if the key can't be found in the `Map` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/has.mdx b/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/has.mdx deleted file mode 100644 index 511508c2ef..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.has() - -The **`has()`** method returns a boolean indicating whether an element with the -specified key exists or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : The key of the element to test for presence in the `Map` object. - -### Return value - -`true` if an element with the specified key exists in the `Map` object; -otherwise `false`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/keys.mdx b/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/keys.mdx deleted file mode 100644 index 2c251fc4da..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/keys.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.keys() - -The **`keys()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the keys for each element in the `Map` object in insertion order. In this particular case, this iterator object is also an iterable, so a [for...of](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loop can be used. - -## Syntax - -```js -keys() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/set.mdx b/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/set.mdx deleted file mode 100644 index 9d073fd7d5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/set.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.set() - -The **`set()`** method adds or updates an entry in a `Map` object with a specified key and a value. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : The key of the element to add to the `Map` object. The key may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). -- `value` - - : The value of the element to add to the `Map` object. The value may be any [JavaScript type](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures) (any [primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_values) or any type of [JavaScript object](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#objects)). - -### Return value - -The `Map` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/size.mdx b/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/size.mdx deleted file mode 100644 index 704f9f3eb3..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/size.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.size - -The **`size`** accessor property returns the number of elements in a -[Map](../../../globals/Map/Map.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Map` object -has. A set accessor function for `size` is `undefined`; you can not change this -property. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/values.mdx b/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/values.mdx deleted file mode 100644 index ffb70b4daa..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Map/prototype/values.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Map.prototype.values() - -The **`values()`** method returns a new -_[iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators)_ object -that contains the values for each element in the `Map` object in insertion -order. - -## Syntax - -```js -values() -``` - -### Return value - -A new [Map](../../../globals/Map/Map.mdx) iterator object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/E.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/E.mdx deleted file mode 100644 index c0fed19f23..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/E.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.E - -The **`Math.E`** property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718. - -## Value - -`2.718281828459045` - -## Description - -Because `E` is a static property of `Math`, you always use it as `Math.E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/LN10.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/LN10.mdx deleted file mode 100644 index 757fa119b2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/LN10.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN10 - -The **`Math.LN10`** property represents the natural logarithm of 10, approximately 2.302. - -## Value - -`2.302585092994046` - -## Description - -Because `LN10` is a static property of `Math`, you always use it as `Math.LN10`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/LN2.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/LN2.mdx deleted file mode 100644 index 265a0ab9da..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/LN2.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LN2 - -The **`Math.LN2`** property represents the natural logarithm of 2, approximately 0.693: - -## Value - -`0.6931471805599453` - -## Description - -Because `LN2` is a static property of `Math`, you always use it as `Math.LN2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/LOG10e.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/LOG10e.mdx deleted file mode 100644 index f1693ade26..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/LOG10e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG10E - -The **`Math.LOG10E`** property represents the base 10 logarithm of [E](./E.mdx), approximately 0.434. - -## Value - -`0.4342944819032518` - -## Description - -Because `LOG10E` is a static property of `Math`, you always use it as `Math.LOG10E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/LOG2e.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/LOG2e.mdx deleted file mode 100644 index 21e6b85f1b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/LOG2e.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.LOG2E - -The **`Math.LOG2E`** property represents the base 2 logarithm of [E](./E.mdx), approximately 1.442. - -## Value - -`1.4426950408889634` - -## Description - -Because `LOG2E` is a static property of `Math`, you always use it as `Math.LOG2E`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/PI.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/PI.mdx deleted file mode 100644 index f50b7bdd4b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/PI.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.PI - -The **`Math.PI`** property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159. - -## Value - -`3.141592653589793` - -## Description - -Because `PI` is a static property of `Math`, you always use it as `Math.PI`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/SQRT1_2.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/SQRT1_2.mdx deleted file mode 100644 index d6c9659ec3..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/SQRT1_2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT1_2 - -The **`Math.SQRT1_2`** property represents the square root of 1/2, which is approximately 0.707. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT1_2` is a constant and a more performant equivalent to [`Math.sqrt(0.5)`](./sqrt.mdx). - -Because `SQRT1_2` is a static property of `Math`, you always use it as `Math.SQRT1_2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/SQRT2.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/SQRT2.mdx deleted file mode 100644 index 2d68428db6..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/SQRT2.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.SQRT2 - -The **`Math.SQRT2`** property represents the square root of 2, approximately 1.414. - -## Value - -`0.7071067811865476` - -## Description - -`Math.SQRT2` is a constant and a more performant equivalent to [`Math.sqrt(2)`](./sqrt.mdx). - -Because `SQRT2` is a static property of `Math`, you always use it as `Math.SQRT2`, rather than as a property of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/abs.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/abs.mdx deleted file mode 100644 index 309eeb3c94..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/abs.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.abs() - -The **`Math.abs()`** function returns the absolute value of a number. - - -## Syntax - -```js -Math.abs(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The absolute value of `x`. If `x` is negative (including `-0`), returns `-x`. Otherwise, returns `x`. The result is therefore always a positive number or `0`. - -## Description - -Because `abs()` is a static method of `Math`, you always use it as `Math.abs()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/acos.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/acos.mdx deleted file mode 100644 index c8aab407ee..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/acos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acos() - -The **`Math.acos()`** function returns the inverse cosine (in radians) of a number. - -## Syntax - -```js -Math.acos(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's cosine value. - -### Return value - -The inverse cosine (angle in radians between 0 and π, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `acos()` is a static method of `Math`, you always use it as `Math.acos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/acosh.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/acosh.mdx deleted file mode 100644 index e3a39478ab..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/acosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.acosh() - -The **`Math.acosh()`** function returns the inverse hyperbolic cosine of a number. - -## Syntax - -```js -Math.acosh(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 1. - -### Return value - -The inverse hyperbolic cosine of `x`. If `x` is less than 1, returns `NaN`. - -## Description - -Because `acosh()` is a static method of `Math`, you always use it as `Math.acosh()`, rather than as a method of a `Math` object you created (`Math` is no constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/asin.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/asin.mdx deleted file mode 100644 index 545b36497b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/asin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asin() - -The **`Math.asin()`** function returns the inverse sine (in radians) of a number. - -## Syntax - -```js -Math.asin(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive, representing the angle's sine value. - -### Return value - -The inverse sine (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `asin()` is a static method of `Math`, you always use it as `Math.asin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/asinh.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/asinh.mdx deleted file mode 100644 index ddeee67d31..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/asinh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.asinh() - -The **`Math.asinh()`** function returns the inverse hyperbolic sine of a number. - -## Syntax - -```js -Math.asinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse hyperbolic sine of `x`. - -## Description - -Because `asinh()` is a static method of `Math`, you always use it as `Math.asinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/atan.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/atan.mdx deleted file mode 100644 index d9f2b6c31a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/atan.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan() - -The **`Math.atan()`** function returns the inverse tangent (in radians) of a number. - -## Syntax - -```js -Math.atan(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The inverse tangent (angle in radians between -π2-\frac{\pi}{2} and π2\frac{\pi}{2}, inclusive) of `x`. If `x` is `Infinity`, it returns π2\frac{\pi}{2}. If `x` is `-Infinity`, it returns -π2-\frac{\pi}{2}. - -## Description - -Because `atan()` is a static method of `Math`, you always use it as `Math.atan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/atan2.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/atan2.mdx deleted file mode 100644 index 69698c2805..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/atan2.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atan2() - -The **`Math.atan2()`** function returns the angle in the plane (in radians) between the positive x-axis and the ray from (0, 0) to the point (x, y), for `Math.atan2(y, x)`. - -## Syntax - -```js -Math.atan2(y, x) -``` - -### Parameters - -- `y` - - : The y coordinate of the point. -- `x` - - : The x coordinate of the point. - -### Return value - -The angle in radians (between -π and π, inclusive) between the positive x-axis and the ray from (0, 0) to the point (x, y). - -## Description - -The `Math.atan2()` method measures the counterclockwise angle θ, in radians, between the positive x-axis and the point `(x, y)`. Note that the arguments to this function pass the y-coordinate first and the x-coordinate second. - -`Math.atan2()` is passed separate `x` and `y` arguments, while [`Math.atan()`](./atan.mdx) is passed the ratio of those two arguments. `Math.atan2(y, x)` differs from `Math.atan(y / x)` in the following cases: - -| `x` | `y` | `Math.atan2(y, x)` | `Math.atan(y / x)` | -| -------------------- | ----------- | ------------------ | ------------------ | -| `Infinity` | `Infinity` | π / 4 | `NaN` | -| `Infinity` | `-Infinity` | -π / 4 | `NaN` | -| `-Infinity` | `Infinity` | 3π / 4 | `NaN` | -| `-Infinity` | `-Infinity` | -3π / 4 | `NaN` | -| 0 | 0 | 0 | `NaN` | -| 0 | -0 | -0 | `NaN` | -| < 0 (including `-0`) | 0 | π | 0 | -| < 0 (including `-0`) | -0 | -π | 0 | -| `-Infinity` | > 0 | π | -0 | -| -0 | > 0 | π / 2 | -π / 2 | -| `-Infinity` | < 0 | -π | 0 | -| -0 | < 0 | -π / 2 | π / 2 | - -In addition, for points in the second and third quadrants (`x < 0`), `Math.atan2()` would output an angle less than -π2-\frac{\pi}{2} or greater than π2\frac{\pi}{2}. - -Because `atan2()` is a static method of `Math`, you always use it as `Math.atan2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/atanh.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/atanh.mdx deleted file mode 100644 index eb9085bdf1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/atanh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.atanh() - -The **`Math.atanh()`** function returns the inverse hyperbolic tangent of a number. - -## Syntax - -```js -Math.atanh(x) -``` - -### Parameters - -- `x` - - : A number between -1 and 1, inclusive. - -### Return value - -The inverse hyperbolic tangent of `x`. If `x` is 1, returns `Infinity`. If `x` is -1, returns `-Infinity`. If `x` is less than -1 or greater than 1, returns `NaN`. - -## Description - -Because `atanh()` is a static method of `Math`, you always use it as `Math.atanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/cbrt.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/cbrt.mdx deleted file mode 100644 index ad3006284c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/cbrt.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cbrt() - -The **`Math.cbrt()`** function returns the cube root of a number. - -## Syntax - -```js -Math.cbrt(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The cube root of `x`. - -## Description - -Because `cbrt()` is a static method of `Math`, you always use it as `Math.cbrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/ceil.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/ceil.mdx deleted file mode 100644 index 715c2d20b3..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/ceil.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.ceil() - -The **`Math.ceil()`** function always rounds up and returns the smaller integer greater than or equal to a given number. - -## Syntax - -```js -Math.ceil(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The smallest integer greater than or equal to `x`. It's the same value as [`-Math.floor(-x)`](./floor.mdx). - -## Description - -Because `ceil()` is a static method of `Math`, you always use it as `Math.ceil()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/clz32.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/clz32.mdx deleted file mode 100644 index 292e2ad9a2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/clz32.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.clz32() - -The **`Math.clz32()`** function returns the number of leading zero bits in the 32-bit binary representation of a number. - -## Syntax - -```js -Math.clz32(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The number of leading zero bits in the 32-bit binary representation of `x`. - -## Description - -`clz32` is short for **C**ount**L**eading**Z**eros**32**. - -If `x` is not a number, it will be converted to a number first, then converted to a 32-bit unsigned integer. - -If the converted 32-bit unsigned integer is `0`, `32` is returned, because all bits are `0`. If the most significant bit is `1` (i.e. the number is greater than or equal to 231), `0` is returned. - -This function is particularly useful for systems that compile to JS, like [Emscripten](https://emscripten.org). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/cos.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/cos.mdx deleted file mode 100644 index 609c5df6a3..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/cos.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cos() - -The **`Math.cos()`** function returns the cosine of a number in radians. - -## Syntax - -```js -Math.cos(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The cosine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `cos()` is a static method of `Math`, you always use it as `Math.cos()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/cosh.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/cosh.mdx deleted file mode 100644 index 044ba1f98b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/cosh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.cosh() - -The **`Math.cosh()`** function returns the hyperbolic cosine of a number. - -## Syntax - -```js -Math.cosh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic cosine of `x`. - -## Description - -Because `cosh()` is a static method of `Math`, you always use it as `Math.cosh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/exp.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/exp.mdx deleted file mode 100644 index 88c7cf3aec..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/exp.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.exp() - -The **`Math.exp()`** function returns [E](./E.mdx) raised to the power of a number. - -## Syntax - -```js -Math.exp(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A nonnegative number representing ex, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -Because `exp()` is a static method of `Math`, you always use it as `Math.exp()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -Beware that `e` to the power of a number very close to 0 will be very close to 1 and suffer from loss of precision. In this case, you may want to use `Math.expm1` instead, and obtain a much higher-precision fractional part of the answer. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/expm1.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/expm1.mdx deleted file mode 100644 index e08d94e4df..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/expm1.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.expm1() - -The **`Math.expm1()`** function returns [E](./E.mdx) raised to the power of a number, subtracted by 1. - -## Syntax - -```js -Math.expm1(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing ex - 1, where e is [the base of the natural logarithm](./E.mdx). - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate ex\mathrm{e}^x where x is a number very close to 0, you should get an answer very close to 1 + x, because limx0ex1x=1\lim\_{x \to 0} \frac{\mathrm{e}^x - 1}{x} = 1. If you calculate `Math.exp(1.1111111111e-15) - 1`, you should get an answer close to `1.1111111111e-15`. Instead, due to the highest significant figure in the result of `Math.exp` being the units digit `1`, the final value ends up being `1.1102230246251565e-15`, with only 3 correct digits. If, instead, you calculate `Math.exp1m(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111111000007e-15`, with 11 correct digits of precision. - -Because `expm1()` is a static method of `Math`, you always use it as `Math.expm1()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/floor.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/floor.mdx deleted file mode 100644 index 9d5ddb0319..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/floor.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.floor() - -The **`Math.floor()`** function always rounds down and returns the largest integer less than or equal to a given number. - -## Syntax - -```js -Math.floor(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The largest integer smaller than or equal to `x`. It's the same value as [`-Math.ceil(-x)`](./ceil.mdx). - -## Description - -Because `floor()` is a static method of `Math`, you always use it as `Math.floor()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/fround.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/fround.mdx deleted file mode 100644 index b2c6b227aa..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/fround.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.fround() - -The **`Math.fround()`** function returns the nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of a number. - -## Syntax - -```js -Math.fround(doubleFloat) -``` - -### Parameters - -- `doubleFloat` - - : A number. - -### Return value - -The nearest [32-bit single precision](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) float representation of `x`. - -## Description - -JavaScript uses 64-bit double floating-point numbers internally, which offer a very high precision. However, sometimes you may be working with 32-bit floating-point numbers, for example if you are reading values from a `Float32Array`. This can create confusion: checking a 64-bit float and a 32-bit float for equality may fail even though the numbers are seemingly identical. - -To solve this, `Math.fround()` can be used to cast the 64-bit float to a 32-bit float. Internally, JavaScript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to `0`. If the number is outside the range of a 32-bit float, `Infinity` or `-Infinity` is returned. - -Because `fround()` is a static method of `Math`, you always use it as `Math.fround()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/hypot.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/hypot.mdx deleted file mode 100644 index f5424c447f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/hypot.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.hypot() - -The **`Math.hypot()`** function returns the square root of the sum of squares of its arguments. - -## Syntax - -```js -Math.hypot() -Math.hypot(value0) -Math.hypot(value0, value1) -Math.hypot(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Numbers. - -### Return value - -The square root of the sum of squares of the given arguments. Returns Infinity if any of the arguments is ±Infinity. Otherwise, if at least one of the arguments is or is converted to NaN, returns NaN. Returns `0` if no arguments are given or all arguments are ±0. - -## Description - -Calculating the hypotenuse of a right triangle, or the magnitude of a complex number, uses the formula `Math.sqrt(v1*v1 + v2*v2)`, where v1 and v2 are the lengths of the triangle's legs, or the complex number's real and complex components. The corresponding distance in 2 or more dimensions can be calculated by adding more squares under the square root: `Math.sqrt(v1*v1 + v2*v2 + v3*v3 + v4*v4)`. - -This function makes this calculation easier and faster; you call `Math.hypot(v1, v2)`, or `Math.hypot(v1, /* … ,*/, vN)`. - -`Math.hypot` also avoids overflow/underflow problems if the magnitude of your numbers is very large. The largest number you can represent in JS is [`Number.MAX_VALUE`](../Number/MAX_VALUE.mdx), which is around 10308. If your numbers are larger than about 10154, taking the square of them will result in Infinity. For example, `Math.sqrt(1e200*1e200 + 1e200*1e200) = Infinity`. If you use `hypot()` instead, you get a better answer: `Math.hypot(1e200, 1e200) = 1.4142...e+200` . This is also true with very small numbers. `Math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0`, but `Math.hypot(1e-200, 1e-200) = 1.4142...e-200`. - -With one argument, `Math.hypot()` is equivalent to [`Math.abs()`](./abs.mdx). [`Math.hypot.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. - -Because `hypot()` is a static method of `Math`, you always use it as `Math.hypot()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/imul.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/imul.mdx deleted file mode 100644 index 5a93e5e4e9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/imul.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.imul() - -The **`Math.imul()`** function returns the result of the C-like 32-bit multiplication of the two parameters. - - -## Syntax - -```js -Math.imul(a, b) -``` - -### Parameters - -- `a` - - : First number. -- `b` - - : Second number. - -### Return value - -The result of the C-like 32-bit multiplication of the given arguments. - -## Description - -`Math.imul()` allows for 32-bit integer multiplication with C-like semantics. This feature is useful for projects like [Emscripten](https://en.wikipedia.org/wiki/Emscripten). - -Because `imul()` is a static method of `Math`, you always use it as `Math.imul()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you use normal JavaScript floating point numbers in `imul()`, you will experience a degrade in performance. This is because of the costly conversion from a floating point to an integer for multiplication, and then converting the multiplied integer back into a floating point. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/log.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/log.mdx deleted file mode 100644 index 4d20ddb905..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/log.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log() - -The **`Math.log()`** function returns the natural logarithm (base [E](./E.mdx)) of a number. - -## Syntax - -```js -Math.log(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x`. If `x` is ±0, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < 0`, returns `NaN`. - -## Description - -Because `log()` is a static method of `Math`, you always use it as `Math.log()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -If you need the natural log of 2 or 10, use the constants `Math.LN2` or `Math.LN10`. If you need a logarithm to base 2 or 10, use `Math.log2()` or `Math.log10()`. If you need a logarithm to other bases, use `Math.log(x) / Math.log(otherBase)` as in the example below; you might want to precalculate `1 / Math.log(otherBase)` since multiplication in `Math.log(x) * constant` is much faster. - -Beware that positive numbers very close to 1 can suffer from loss of precision and make its natural logarithm less accurate. In this case, you may want to use `Math.log1p` instead. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/log10.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/log10.mdx deleted file mode 100644 index 3a60f19992..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/log10.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log10() - -The **`Math.log10()`** function returns the base 10 logarithm of a number. - -## Syntax - -```js -Math.log10(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 10 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log10()` is a static method of `Math`, you always use it as `Math.log10()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(10)`. For `log10(e)`, use the constant `Math.LOG10E`, which is 1 / `Math.LN10`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/log1p.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/log1p.mdx deleted file mode 100644 index 5cc32349dc..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/log1p.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log1p() - -The **`Math.log1p()`** function returns the natural logarithm (base [E](./E.mdx)) of `1 + x`, where `x` is the argument. - -## Syntax - -```js -Math.log1p(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to -1. - -### Return value - -The natural logarithm (base [E](./E.mdx)) of `x + 1`. If `x` is -1, returns [`-Infinity`](../Number/NEGATIVE_INFINITY.mdx). If `x < -1`, returns `NaN`. - -## Description - -For very small values of _x_, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 \= 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. - -When you calculate log(1 + _x_) where _x_ is a small positive number, you should get an answer very close to _x_, because limx0log(1+x)x=1\lim\_{x \to 0} \frac{\log(1+x)}{x} = 1. If you calculate `Math.log(1 + 1.1111111111e-15)`, you should get an answer close to `1.1111111111e-15`. Instead, you will end up taking the logarithm of `1.00000000000000111022` (the roundoff is in binary, so sometimes it gets ugly), and get the answer 1.11022…e-15, with only 3 correct digits. If, instead, you calculate `Math.log1p(1.1111111111e-15)`, you will get a much more accurate answer `1.1111111110999995e-15`, with 15 correct digits of precision (actually 16 in this case). - -If the value of `x` is less than -1, the return value is always `NaN`. - -Because `log1p()` is a static method of `Math`, you always use it as `Math.log1p()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/log2.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/log2.mdx deleted file mode 100644 index 0a5390de6f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/log2.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.log2() - -The **`Math.log2()`** function returns the base 2 logarithm of a number. - -## Syntax - -```js -Math.log2(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The base 2 logarithm of `x`. If `x < 0`, returns `NaN`. - -## Description - -Because `log2()` is a static method of `Math`, you always use it as `Math.log2()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -This function is the equivalent of `Math.log(x) / Math.log(2)`. For `log2(e)`, use the constant `Math.LOG2E`, which is 1 / `Math.LN2`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/max.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/max.mdx deleted file mode 100644 index a1aa326338..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/max.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.max() - -The **`Math.max()`** function returns the largest of the numbers given as input parameters, or `-Infinity` if there are no parameters. - -## Syntax - -```js -Math.max() -Math.max(value0) -Math.max(value0, value1) -Math.max(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, `value2`, … , `valueN` - - : Zero or more numbers among which the largest value will be selected and returned. - -### Return value - -The largest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `-Infinity` if no parameters are provided. - -## Description - -Because `max()` is a static method of `Math`, you always use it as `Math.max()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.max.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/min.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/min.mdx deleted file mode 100644 index 3da257c557..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/min.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.min() - -The **`Math.min()`** function returns the smallest of the numbers given as input parameters, or `Infinity` if there are no parameters. - -## Syntax - -```js -Math.min() -Math.min(value0) -Math.min(value0, value1) -Math.min(value0, value1, /* … ,*/ valueN) -``` - -### Parameters - -- `value1`, …, `valueN` - - : Zero or more numbers among which the lowest value will be selected and returned. - -### Return value - -The smallest of the given numbers. Returns `NaN` if any of the parameters is or is converted into `NaN`. Returns `Infinity` if no parameters are provided. - -## Description - -Because `min()` is a static method of `Math`, you always use it as `Math.min()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - -[`Math.min.length`](../Function/prototype/length.mdx) is 2, which weakly signals that it's designed to handle at least two parameters. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/pow.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/pow.mdx deleted file mode 100644 index a7696e1b44..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/pow.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.pow() - -The **`Math.pow()`** method returns the value of a base raised to a power. - -## Syntax - -```js -Math.pow(base, exponent) -``` - -### Parameters - -- `base` - - : The base number. -- `exponent` - - : The exponent number. - -### Return value - -A number representing `base` taken to the power of `exponent`. Returns `NaN` in one of the following cases: - -- `exponent` is `NaN`. -- `base` is `NaN` and `exponent` is not `0`. -- `base` is ±1 and `exponent` is ±`Infinity`. -- `base < 0` and `exponent` is not an integer. - -## Description - -`Math.pow()` is equivalent to the `**` operator, except `Math.pow()` only accepts numbers. - -`Math.pow(NaN, 0)` (and the equivalent `NaN ** 0`) is the only case where `NaN` doesn't propagate through mathematical operations — it returns `1` despite the operand being `NaN`. In addition, the behavior where `base` is 1 and `exponent` is non-finite (±Infinity or `NaN`) is different from IEEE 754, which specifies that the result should be 1, whereas JavaScript returns `NaN` to preserve backward compatibility with its original behavior. - -Because `pow()` is a static method of `Math`, use it as `Math.pow()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/random.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/random.mdx deleted file mode 100644 index 0a993fc445..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/random.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.random() - -The **`Math.random()`** function returns a floating-point, pseudo-random number that's greater than or equal to 0 and less than 1, with approximately uniform distribution over that range — which you can then scale to your desired range. The implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user. - -> **Note:** `Math.random()` _does not_ provide cryptographically secure random numbers. Do not use them for anything related to security. Use the Web Crypto API instead, and more precisely the `crypto.getRandomValues()` method. - -## Syntax - -```js -Math.random() -``` - -### Return value - -A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/round.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/round.mdx deleted file mode 100644 index bb4e7cca69..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/round.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.round() - -The **`Math.round()`** function returns the value of a number rounded to the nearest integer. - -## Syntax - -```js -Math.round(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The value of `x` rounded to the nearest integer. - -## Description - -If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. If it is less than 0.5, the argument is rounded to the integer with the lower absolute value. If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. - -> **Note:** This differs from many languages' `round()` functions, which often round half-increments _away from zero_, giving a different result in the case of negative numbers with a fractional part of exactly 0.5. - -`Math.round(x)` is not exactly the same as [`Math.floor(x + 0.5)`](./floor.mdx). When `x` is -0, or -0.5 ≤ x < 0, `Math.round(x)` returns -0, while `Math.floor(x + 0.5)` returns 0. However, neglecting that difference and potential precision errors, `Math.round(x)` and `Math.floor(x + 0.5)` are generally equivalent. - -Because `round()` is a static method of `Math`, you always use it as `Math.round()`, rather than as a method of a `Math` object you created (`Math` has no constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/sign.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/sign.mdx deleted file mode 100644 index d5d734e69b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/sign.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sign() - -The **`Math.sign()`** function returns 1 or -1, indicating the sign of the number passed as argument. If the input is 0 or -0, it will be returned as-is. - -## Syntax - -```js -Math.sign(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -A number representing the sign of `x`: - -- If `x` is positive, returns `1`. -- If `x` is negative, returns `-1`. -- If `x` is positive zero, returns `0`. -- If `x` is negative zero, returns `-0`. -- Otherwise, returns `NaN`. - -## Description - -Because `sign()` is a static method of `Math`, you always use it as `Math.sign()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/sin.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/sin.mdx deleted file mode 100644 index bec94a2afe..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/sin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sin() - -The **`Math.sin()`** function returns the sine of a number in radians. - -## Syntax - -```js -Math.sin(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The sine of `x`, between -1 and 1, inclusive. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -## Description - -Because `sin()` is a static method of `Math`, you always use it as `Math.sin()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/sinh.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/sinh.mdx deleted file mode 100644 index c9ee509799..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/sinh.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sinh() - -The **`Math.sinh()`** function returns the hyperbolic sine of a number. - -## Syntax - -```js -Math.sinh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic sine of `x`. - -## Description - -Because `sinh()` is a static method of `Math`, you always use it as `Math.sinh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/sqrt.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/sqrt.mdx deleted file mode 100644 index feb50bb4dd..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/sqrt.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.sqrt() - -The **`Math.sqrt()`** function returns the square root of a number. - -## Syntax - -```js -Math.sqrt(x) -``` - -### Parameters - -- `x` - - : A number greater than or equal to 0. - -### Return value - -The square root of `x`, a nonnegative number. If `x < 0`, returns `NaN`. - -## Description - -Because `sqrt()` is a static method of `Math`, you always use it as `Math.sqrt()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). - diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/tan.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/tan.mdx deleted file mode 100644 index 905ed2fad5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/tan.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tan() - -The **`Math.tan()`** function returns the tangent of a number in radians. - - -## Syntax - -```js -Math.tan(x) -``` - -### Parameters - -- `x` - - : A number representing an angle in radians. - -### Return value - -The tangent of `x`. If `x` is `Infinity`, `-Infinity`, or `NaN`, returns `NaN`. - -> **Note:** Due to floating point precision, it's not possible to obtain the exact value π/2, so the result is always finite if not `NaN`. - -## Description - -Because `tan()` is a static method of `Math`, you always use it as `Math.tan()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/tanh.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/tanh.mdx deleted file mode 100644 index 593fa04c62..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/tanh.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.tanh() - -The **`Math.tanh()`** function returns the hyperbolic tangent of a number. - -## Syntax - -```js -Math.tanh(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The hyperbolic tangent of `x`. - -## Description - -Because `tanh()` is a static method of `Math`, you always use it as `Math.tanh()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Math/trunc.mdx b/documentation/versioned_docs/version-3.9.0/globals/Math/trunc.mdx deleted file mode 100644 index 1a8006a947..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Math/trunc.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Math.trunc() - -The **`Math.trunc()`** function returns the integer part of a number by removing any fractional digits. - -## Syntax - -```js -Math.trunc(x) -``` - -### Parameters - -- `x` - - : A number. - -### Return value - -The integer part of `x`. - -## Description - -Unlike the other three `Math` methods: `Math.floor()`, `Math.ceil()` and `Math.round()`, the way `Math.trunc()` works is very simple. It _truncates_ (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. - -Because `trunc()` is a static method of `Math`, you always use it as `Math.trunc()`, rather than as a method of a `Math` object you created (`Math` is not a constructor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/NaN.mdx b/documentation/versioned_docs/version-3.9.0/globals/NaN.mdx deleted file mode 100644 index 75c5978802..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/NaN.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# NaN - -The global **`NaN`** property is a value representing Not-A-Number. - -## Value - -The same number value as [`Number.NaN`](./Number/NaN.mdx). - -## Description - -`NaN` is a property of the _global object_. In other words, it is a variable in global scope. - -In modern browsers, `NaN` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. - -There are five different types of operations that return `NaN`: - -- Failed number conversion (e.g. explicit ones like `parseInt("blabla")`, `Number(undefined)`, or implicit ones like `Math.abs(undefined)`) -- Math operation where the result is not a real number (e.g. `Math.sqrt(-1)`) -- Indeterminate form (e.g. `0 * Infinity`, `1 ** Infinity`, `Infinity / Infinity`, `Infinity - Infinity`) -- A method or expression whose operand is or gets coerced to `NaN` (e.g. `7 ** NaN`, `7 * "blabla"`) — this means `NaN` is contagious -- Other cases where an invalid value is to be represented as a number (e.g. an invalid `new Date("blabla").getTime()`, `"".charCodeAt(1)`) - -`NaN` and its behaviors are not invented by JavaScript. Its semantics in floating point arithmetic (including that `NaN !== NaN`) are specified by [IEEE 754](https://en.wikipedia.org/wiki/Double_precision_floating-point_format). `NaN`'s behaviors include: - -- If `NaN` is involved in a mathematical operation (but not [bitwise operations](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators#bitwise_shift_operators)), the result is usually also `NaN`. (See [counter-example](#silently_escaping_nan) below.) -- When `NaN` is one of the operands of any relational comparison (`>`, `<`, `>=`, `<=`), the result is always `false`. -- `NaN` compares unequal (via [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality), [`!=`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Inequality), [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality), and [`!==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_inequality)) to any other value — including to another `NaN` value. - -`NaN` is also one of the [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) values in JavaScript. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/MAX_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/MAX_SAFE_INTEGER.mdx deleted file mode 100644 index 73c98ee36c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/MAX_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_SAFE_INTEGER - -The **`Number.MAX_SAFE_INTEGER`** constant represents the maximum safe integer in JavaScript (253 – 1). - -For larger integers, consider using `BigInt`. - -## Value - -`9007199254740991` (9,007,199,254,740,991, or \~9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. "Safe" in this context refers to the ability to represent integers exactly and to compare them correctly. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/MAX_VALUE.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/MAX_VALUE.mdx deleted file mode 100644 index 8d9e227047..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/MAX_VALUE.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MAX_VALUE - -The **`Number.MAX_VALUE`** property represents the maximum numeric value representable in JavaScript. - -## Value - -21024 - 1, or approximately `1.7976931348623157E+308`. - -## Description - -Values larger than `MAX_VALUE` are represented as [`Infinity`](../../globals/Infinity.mdx) and will lose their actual value. - -Because `MAX_VALUE` is a static property of `Number`, you always use it as `Number.MAX_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/MIN_SAFE_INTEGER.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/MIN_SAFE_INTEGER.mdx deleted file mode 100644 index cafc75993e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/MIN_SAFE_INTEGER.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_SAFE_INTEGER - -The **`Number.MIN_SAFE_INTEGER`** constant represents the minimum safe integer in JavaScript, or -(253 - 1). - -To represent integers smaller than this, consider using `BigInt`. - -## Value - -`-9007199254740991` (-9,007,199,254,740,991, or about -9 quadrillion). - -## Description - -[Double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), so it can only safely represent integers between -(253 – 1) and 253 – 1. Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2` will evaluate to true, which is mathematically incorrect. See `Number.isSafeInteger()` for more information. - -Because `MIN_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MIN_SAFE_INTEGER`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/MIN_VALUE.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/MIN_VALUE.mdx deleted file mode 100644 index 390e406741..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/MIN_VALUE.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.MIN_VALUE - -The **`Number.MIN_VALUE`** property represents the smallest positive numeric value representable in JavaScript. - -## Value - -2-1074, or `5E-324`. - -## Description - -`Number.MIN_VALUE` is the smallest positive number (not the most negative number) that can be represented within float precision — in other words, the number closest to 0. The ECMAScript spec doesn't define a precise value that implementations are required to support — instead the spec says, _"must be the smallest non-zero positive value that can actually be represented by the implementation"_. This is because small IEEE-754 floating point numbers are [denormalized](https://en.wikipedia.org/wiki/Subnormal_number), but implementations are not required to support this representation, in which case `Number.MIN_VALUE` may be larger. - -In practice, its precise value in mainstream engines like V8 (used by Chrome, Edge, Node.js), SpiderMonkey (used by Firefox), and JavaScriptCore (used by Safari) is 2-1074, or `5E-324`. - -Because `MIN_VALUE` is a static property of `Number`, you always use it as `Number.MIN_VALUE`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/NEGATIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/NEGATIVE_INFINITY.mdx deleted file mode 100644 index 86674c08fb..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/NEGATIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NEGATIVE_INFINITY - -The **`Number.NEGATIVE_INFINITY`** property represents the negative Infinity value. - -## Value - -The same as the negative value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.NEGATIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.NEGATIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any positive value divided by `Number.NEGATIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative value divided by `Number.NEGATIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Zero multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- [`NaN`](../../globals/NaN.mdx) multiplied by `Number.NEGATIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.NEGATIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.NEGATIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `x > Number.NEGATIVE_INFINITY` is true for any number _x_ that isn't `Number.NEGATIVE_INFINITY`. - -You might use the `Number.NEGATIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.NEGATIVE_INFINITY` is a static property of `Number`, you always use it as `Number.NEGATIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/NaN.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/NaN.mdx deleted file mode 100644 index 6a194ac882..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/NaN.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.NaN - -The **`Number.NaN`** property represents Not-A-Number, which is equivalent to [description for the global property](../../globals/NaN.mdx). For more information about the behaviors of `NaN`, see the [`NaN`](../../globals/NaN.mdx). - -## Value - -The number value [`NaN`](../../globals/NaN.mdx). - -## Description - -Because `NaN` is a static property of `Number`, you always use it as `Number.NaN`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/Number.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/Number.mdx deleted file mode 100644 index 3816c592f5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/Number.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number() constructor - -The **`Number()` constructor** creates a `Number` object. When called instead as a function, it performs type conversion to a primitive number, which is usually more useful. - -## Syntax - -```js -new Number(value) -Number(value) -``` - -> **Note:** `Number()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `value` - - : The numeric value of the object being created. - -### Return value - -When `Number` is called as a constructor (with `new`), it creates a `Number` object, which is **not** a primitive. - -When `Number` is called as a function, it [coerces the parameter to a number primitive](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion). [BigInts](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt) are converted to numbers. If the value can't be converted, it returns [`NaN`](../../globals/NaN.mdx). - -> **Warning:** You should rarely find yourself using `Number` as a constructor. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/POSITIVE_INFINITY.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/POSITIVE_INFINITY.mdx deleted file mode 100644 index ca686c0ec1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/POSITIVE_INFINITY.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.POSITIVE_INFINITY - -The **`Number.POSITIVE_INFINITY`** property represents the positive Infinity value. - -## Value - -The same as the value of the global [`Infinity`](../../globals/Infinity.mdx) property. - -## Description - -The `Number.POSITIVE_INFINITY` value behaves slightly differently than mathematical infinity: - -- Any positive value, including `Number.POSITIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.POSITIVE_INFINITY`. -- Any negative value, including `Number.NEGATIVE_INFINITY`, multiplied by `Number.POSITIVE_INFINITY` is `Number.NEGATIVE_INFINITY`. -- Any positive number divided by `Number.POSITIVE_INFINITY` is [positive zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754)). -- Any negative number divided by `Number.POSITIVE_INFINITY` is [negative zero](https://en.wikipedia.org/wiki/Signed_zero) (as defined in [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). -- Zero multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `NaN` multiplied by `Number.POSITIVE_INFINITY` is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY`, divided by any negative value except `Number.NEGATIVE_INFINITY`, is `Number.NEGATIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by any positive value except `Number.POSITIVE_INFINITY`, is `Number.POSITIVE_INFINITY`. -- `Number.POSITIVE_INFINITY`, divided by either `Number.NEGATIVE_INFINITY` or `Number.POSITIVE_INFINITY`, is [`NaN`](../../globals/NaN.mdx). -- `Number.POSITIVE_INFINITY > x` is true for any number _x_ that isn't `Number.POSITIVE_INFINITY`. - -You might use the `Number.POSITIVE_INFINITY` property to indicate an error condition that returns a finite number in case of success. Note, however, that [`NaN`](../../globals/NaN.mdx) would be more appropriate in such a case. - -Because `Number.POSITIVE_INFINITY` is a static property of `Number`, you always use it as `Number.POSITIVE_INFINITY`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/epsilon.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/epsilon.mdx deleted file mode 100644 index ff27e9f62f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/epsilon.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.EPSILON - -The **`Number.EPSILON`** property represents the difference between 1 and the smallest floating point number greater than 1. - -## Value - -2-52, or approximately `2.2204460492503130808472633361816E-16`. - -## Description - -`Number.EPSILON` is the difference between 1 and the next greater number representable in the Number format, because [double precision floating point format](https://en.wikipedia.org/wiki/Double_precision_floating-point_format) only has 52 bits to represent the [mantissa](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding), and the lowest bit has a significance of 2-52. - -Note that the absolute accuracy of floating numbers decreases as the number gets larger, because the exponent grows while the mantissa's accuracy stays the same. `Number.MIN_VALUE` is the smallest representable positive number, which is much smaller than `Number.EPSILON`. - -Because `EPSILON` is a static property of `Number`, you always use it as `Number.EPSILON`, rather than as a property of a number value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/isFinite.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/isFinite.mdx deleted file mode 100644 index 20313b5766..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/isFinite.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isFinite() - -The **`Number.isFinite()`** method determines whether the passed value is a finite number — that is, it checks that a given value is a number, and the number is neither positive [`Infinity`](../../globals/Infinity.mdx), negative `Infinity`, nor [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.isFinite(value) -``` - -### Parameters - -- `value` - - : The value to be tested for finiteness. - -### Return value - -The boolean value `true` if the given value is a finite number. Otherwise `false`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/isInteger.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/isInteger.mdx deleted file mode 100644 index 06783b1524..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/isInteger.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isInteger() - -The **`Number.isInteger()`** method determines whether the passed value is an integer. - -## Syntax - -```js -Number.isInteger(value) -``` - -### Parameters - -- `value` - - : The value to be tested for being an integer. - -### Return value - -The boolean value `true` if the given value is an integer. Otherwise `false`. - -## Description - -If the target value is an integer, return `true`, otherwise return `false`. If the value is [`NaN`](../../globals/NaN.mdx) or [`Infinity`](../../globals/Infinity.mdx), return `false`. The method will also return `true` for floating point numbers that can be represented as integer. It will always return `false` if the value is not a number. - -Note that some number literals, while looking like non-integers, actually represent integers — due to the precision limit of ECMAScript floating-point number encoding (IEEE-754). For example, `5.0000000000000001` only differs from `5` by `1e-16`, which is too small to be represented. (For reference, [`Number.EPSILON`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON) stores the distance between 1 and the next representable floating-point number greater than 1, and that is about `2.22e-16`.) Therefore, `5.0000000000000001` will be represented with the same encoding as `5`, thus making `Number.isInteger(5.0000000000000001)` return `true`. - -In a similar sense, numbers around the magnitude of [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) will suffer from loss of precision and make `Number.isInteger` return `true` even when it's not an integer. (The actual threshold varies based on how many bits are needed to represent the decimal — for example, `Number.isInteger(4500000000000000.1)` is `true`, but `Number.isInteger(4500000000000000.5)` is `false`.) diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/isNaN.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/isNaN.mdx deleted file mode 100644 index 2244aabc9d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/isNaN.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isNaN() - -The **`Number.isNaN()`** method determines whether the passed value is the number value [`NaN`](../../globals/NaN.mdx), and returns `false` if the input is not of the Number type. It is a more robust version of the original, global `isNaN()` function. - -## Syntax - -```js -Number.isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested for [`NaN`](../../globals/NaN.mdx). - -### Return value - -The boolean value `true` if the given value is a number with value [`NaN`](../../globals/NaN.mdx). Otherwise, `false`. - -## Description - -The function `Number.isNaN()` provides a convenient way to check for equality with `NaN`. Note that you cannot test for equality with `NaN` using either the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) or [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operators, because unlike all other value comparisons in JavaScript, these evaluate to `false` whenever one operand is [`NaN`](../../globals/NaN.mdx), even if the other operand is also [`NaN`](../../globals/NaN.mdx). - -Since `x !== x` is only true for `NaN` among all possible JavaScript values, `Number.isNaN(x)` can also be replaced with a test for `x !== x`, despite the latter being less readable. - -As opposed to the global `isNaN()` function, the `Number.isNaN()` method doesn't force-convert the parameter to a number. This makes it safe to pass values that would normally convert to [`NaN`](../../globals/NaN.mdx) but aren't actually the same value as [`NaN`](../../globals/NaN.mdx). This also means that only values of the Number type that are also [`NaN`](../../globals/NaN.mdx) return `true`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/isSafeInteger.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/isSafeInteger.mdx deleted file mode 100644 index afd3f5ff0f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/isSafeInteger.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.isSafeInteger() - -The **`Number.isSafeInteger()`** method determines whether the provided value is a number that is a _safe integer_. - -## Syntax - -```js -Number.isSafeInteger(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for being a safe integer. - -### Return value - -The boolean value `true` if the given value is a number that is a safe integer. Otherwise `false`. - -## Description - -The safe integers consist of all integers from -(253 - 1) to 253 - 1, inclusive (±9,007,199,254,740,991). A safe integer is an integer that: - -- can be exactly represented as an IEEE-754 double precision number, and -- whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. - -For example, 253 - 1 is a safe integer: it can be exactly represented, and no other integer rounds to it under any IEEE-754 rounding mode. In contrast, 253 is _not_ a safe integer: it can be exactly represented in IEEE-754, but the integer 253 + 1 can't be directly represented in IEEE-754 but instead rounds to 253 under round-to-nearest and round-to-zero rounding. - -Handling values larger or smaller than \~9 quadrillion with full precision requires using an [arbitrary precision arithmetic library](https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic). See [What Every Programmer Needs to Know about Floating Point Arithmetic](https://floating-point-gui.de/) for more information on floating point representations of numbers. - -For larger integers, consider using the `BigInt` type. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/parseFloat.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/parseFloat.mdx deleted file mode 100644 index d0aaa18f89..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/parseFloat.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseFloat() - -The **`Number.parseFloat()`** method parses an argument and returns a floating point number. If a number cannot be parsed from the argument, it returns [`NaN`](../../globals/NaN.mdx). - -## Syntax - -```js -Number.parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`. - -Or [`NaN`](../../globals/NaN.mdx) when the first non-whitespace character cannot be converted to a number. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/parseInt.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/parseInt.mdx deleted file mode 100644 index 692735f789..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/parseInt.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.parseInt() - -The **`Number.parseInt()`** method parses a string argument and -returns an integer of the specified radix or base. - -## Syntax - -```js -Number.parseInt(string) -Number.parseInt(string, radix) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the - _radix_ (the base in mathematical numeral systems) of the - `string`. - - If `radix` is undefined or `0`, it is assumed to be `10` except when the number begins with the code unit pairs `0x` or `0X`, in which case a radix of `16` is assumed. - -### Return value - -An integer parsed from the given `string`. - -If the `radix` is smaller than `2` or bigger than -`36`, or the first non-whitespace character cannot be converted to a number, -[`NaN`](../../globals/NaN.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toExponential.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toExponential.mdx deleted file mode 100644 index f28f0480e5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toExponential.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toExponential() - -The **`toExponential()`** method returns a string representing -the `Number` object in exponential notation. - -## Syntax - -```js -toExponential() -toExponential(fractionDigits) -``` - -### Parameters - -- `fractionDigits` _**optional**_ - - : Optional. An integer specifying the number of digits after the decimal point. - Defaults to as many digits as necessary to specify the number. - -### Return value - -A string representing the given `Number` object in exponential notation -with one digit before the decimal point, rounded to -`fractionDigits` digits after the decimal point. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `fractionDigits` is too small or too large. Values between - `0` and `100`, inclusive, will not cause a - [`RangeError`](../../../globals/RangeError/RangeError.mdx). -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -If the `fractionDigits` argument is omitted, the number of digits -after the decimal point defaults to the number of digits necessary to represent the -value uniquely. - -If you use the `toExponential()` method for a numeric literal and the -numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot -that precedes the method call to prevent the dot from being interpreted as a decimal -point. - -If a number has more digits than requested by the -`fractionDigits` parameter, the number is rounded to the nearest -number represented by `fractionDigits` digits. See the discussion -of rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, which also applies to `toExponential()`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toFixed.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toFixed.mdx deleted file mode 100644 index 1cf54a210b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toFixed.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toFixed() - -The **`toFixed()`** method formats a number using fixed-point notation. - -## Syntax - -```js -toFixed() -toFixed(digits) -``` - -### Parameters - -- `digits` _**optional**_ - - : The number of digits to appear after the decimal point; should be a value between `0` and `100`, inclusive. If this argument is omitted, it is treated as `0`. - -### Return value - -A string representing the given number using fixed-point notation. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : If `digits` is smaller than `0`, larger than `100`, or is `NaN`. -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If this method is invoked on an object that is not a `Number`. - -## Description - -The `toFixed()` method returns a string representation of `numObj` that does not use exponential notation and has exactly `digits` digits after the decimal place. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. - -If the absolute value of `numObj` is greater or equal to 1021, this method uses the same algorithm as [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and returns a string in exponential notation. `toFixed()` returns `"Infinity"`, `"NaN"`, or `"-Infinity"` if the value of `numObj` is non-finite. - -The output of `toFixed()` may be more precise than [`toString()`](../../../globals/Number/prototype/toString.mdx) for some values, because `toString()` only prints enough significant digits to distinguish the number from adjacent number values. For example: - -```js -(1000000000000000128).toString(); // '1000000000000000100' -(1000000000000000128).toFixed(0); // '1000000000000000128' -``` - -However, choosing a `digits` precision that's too high can return unexpected results, because decimal fractional numbers cannot be represented precisely in floating point. For example: - -```js -0.3.toFixed(50); // '0.29999999999999998889776975374843459576368331909180' -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toLocaleString.mdx deleted file mode 100644 index af6320aee2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toLocaleString.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string with a language-sensitive representation of this number. In implementations with [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) support, this method simply calls `Intl.NumberFormat`. - -## Syntax - -```js -toLocaleString() -toLocaleString(locales) -toLocaleString(locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.NumberFormat` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), these parameters correspond exactly to the [`Intl.NumberFormat()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) constructor's parameters. Implementations without `Intl.NumberFormat` support are asked to ignore both parameters, making the locale used and the form of the string returned entirely implementation-dependent. - -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options) parameter of the `Intl.NumberFormat()` constructor. - - In implementations without `Intl.NumberFormat` support, this parameter is ignored. - -See the [`Intl.NumberFormat()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat) for details on these parameters and how to use them. - -### Return value - -A string with a language-sensitive representation of the given number. - -In implementations with `Intl.NumberFormat`, this is equivalent to `new Intl.NumberFormat(locales, options).format(number)`. - -## Performance - -When formatting large numbers of numbers, it is better to create a -`Intl.NumberFormat` object and use the function provided by its -`format` property. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toPrecision.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toPrecision.mdx deleted file mode 100644 index 5d606c4137..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toPrecision.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toPrecision() - -The **`toPrecision()`** method returns a string representing -the `Number` object to the specified precision. - -## Syntax - -```js -toPrecision() -toPrecision(precision) -``` - -### Parameters - -- `precision` _**optional**_ - - : An integer specifying the number of significant digits. - -### Return value - -A string representing a `Number` object in fixed-point or exponential -notation rounded to `precision` significant digits. See the discussion of -rounding in the description of the [`Number.prototype.toFixed()`](../../../globals/Number/prototype/toFixed.mdx) method, -which also applies to `toPrecision()`. - -If the `precision` argument is omitted, behaves as -[`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx). If the `precision` argument is a -non-integer value, it is rounded to the nearest integer. - -### Exceptions - -- `RangeError` - - : If `precision` is not between `1` and `100` - (inclusive), a [`RangeError`](../../../globals/RangeError/RangeError.mdx) is thrown. Implementations are allowed to - support larger and smaller values as well. ECMA-262 only requires a precision of up to - 21 significant digits. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toString.mdx deleted file mode 100644 index 1726687b9f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/toString.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.toString() - -The **`toString()`** method returns a string representing the specified number value. - -## Syntax - -```js -toString() -toString(radix) -``` - -### Parameters - -- `radix` _**optional**_ - - : An integer in the range `2` through `36` specifying the base to use for representing the number value. Defaults to 10. - -### Return value - -A string representing the specified number value. - -### Exceptions - -- [`RangeError`](../../../globals/RangeError/RangeError.mdx) - - : Thrown if `radix` is less than 2 or greater than 36. - -## Description - -The `Number` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Number` values, the `toString` method returns a string representation of the value in the specified radix. - -For radixes above 10, the letters of the alphabet indicate digits greater than 9. For example, for hexadecimal numbers (base 16) `a` through `f` are used. - -If the specified number value is negative, the sign is preserved. This is the case even if the radix is 2; the string returned is the positive binary representation of the number value preceded by a `-` sign, **not** the two's complement of the number value. - -Both `0` and `-0` have `"0"` as their string representation. [`Infinity`](../../../globals/Infinity.mdx) returns `"Infinity"` and [`NaN`](../../../globals/NaN.mdx) returns `"NaN"`. - -If the number is not a whole number, the decimal point `.` is used to separate the decimal places. [Scientific notation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#exponential) is used if the radix is 10 and the number's magnitude (ignoring sign) is greater than or equal to 1021 or less than 10-6. In this case, the returned string always explicitly specifies the sign of the exponent. - -```js -console.log((10 ** 21.5).toString()); // "3.1622776601683794e+21" -console.log((10 ** 21.5).toString(8)); // "526665530627250154000000" -``` - -The `toString()` method requires its `this` value to be a `Number` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to number values. - -Because `Number` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Number` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, Number _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation. - -```js -Number.prototype.toString = () => "Overridden"; -console.log(`${1}`); // "1" -console.log(`${new Number(1)}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/valueOf.mdx deleted file mode 100644 index 3a1eeb6e4b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Number/prototype/valueOf.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Number.prototype.valueOf() - -The **`valueOf()`** method returns the wrapped primitive value -of a `Number` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A number representing the primitive value of the specified `Number` object. - -## Description - -This method is usually called internally by JavaScript and not explicitly in web code. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/Object.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/Object.mdx deleted file mode 100644 index cbff96e7eb..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/Object.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object() - -The **`Object` constructor** turns the input into an object. Its behavior depends on the input's type. - -- If the value is [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx), it creates and returns an empty object. -- Otherwise, it returns an object of a Type that corresponds to the given value. -- If the value is an object already, it returns the value. - -## Syntax - -```js -new Object(value) -Object(value) -``` - -> **Note:** `Object()` can be called with or without `new`. Both create a new object. - -### Parameters - -- `value` - - : Any value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/assign.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/assign.mdx deleted file mode 100644 index ce32bec9fd..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/assign.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.assign() - -The **`Object.assign()`** method -copies all [enumerable](../../globals/Object/prototype/propertyIsEnumerable.mdx) -[own properties](../../globals/Object/hasOwn.mdx) from one or more -_source objects_ to a _target object_. It returns the modified target -object. - -## Syntax - -```js -Object.assign(target, ...sources) -``` - -### Parameters - -- `target` - - : The target object — what to apply the sources' properties to, which is returned - after it is modified. -- `sources` - - : The source object(s) — objects containing the properties you want to apply. - -### Return value - -The target object. - -## Description - -Properties in the target object are overwritten by properties in the sources if they -have the same "key". Later sources' properties overwrite earlier ones. - -The `Object.assign()` method only copies _enumerable_ and -_own_ properties from a source object to a target object. It uses -`[[Get]]` on the source and `[[Set]]` on the target, so it will -invoke [getters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/set). Therefore it -_assigns_ properties, versus copying or defining new properties. This may make it -unsuitable for merging new properties into a prototype if the merge sources contain -getters. - -For copying property definitions (including their enumerability) into prototypes, use -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) and -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) instead. - -Both `String` and `Symbol` properties are copied. - -In case of an error, for example if a property is non-writable, a -[`TypeError`](../../globals/TypeError/TypeError.mdx) is raised, and the `target` object is -changed if any properties are added before the error is raised. - -> **Note:** `Object.assign()` does not throw on -> [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../globals/undefined.mdx) sources. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/create.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/create.mdx deleted file mode 100644 index 80f632eed0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/create.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.create() - -The **`Object.create()`** method creates a new object, using an existing object as the prototype of the newly created object. - -## Syntax - -```js -Object.create(proto) -Object.create(proto, propertiesObject) -``` - -### Parameters - -- `proto` - - : The object which should be the prototype of the newly-created object. -- `propertiesObject` _**optional**_ - - : If specified and not [`undefined`](../../globals/undefined.mdx), an object whose [enumerable own properties](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) specify property descriptors to be added to the newly-created object, with the corresponding property names. These properties correspond to the second argument of [`Object.defineProperties()`](../../globals/Object/defineProperties.mdx). - -### Return value - -A new object with the specified prototype object and properties. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if `proto` is neither [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) nor an `Object`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/defineProperties.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/defineProperties.mdx deleted file mode 100644 index e3b8525201..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/defineProperties.mdx +++ /dev/null @@ -1,71 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperties() - -The **`Object.defineProperties()`** method defines new or -modifies existing properties directly on an object, returning the object. - -## Syntax - -```js -Object.defineProperties(obj, props) -``` - -### Parameters - -- `obj` - - : The object on which to define or modify properties. -- `props` - - - : An object whose keys represent the names of properties to be defined or modified and - whose values are objects describing those properties. Each value in `props` - must be either a data descriptor or an accessor descriptor; it cannot be both (see - [`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) for more details). - - Data descriptors and accessor descriptors may optionally contain the following keys: - - - `configurable` - - : `true` if and only if the type of this property descriptor may be - changed and if the property may be deleted from the corresponding object. - **Defaults to `false`.** - - `enumerable` - - : `true` if and only if this property shows up during enumeration of - the properties on the corresponding object. - **Defaults to `false`.** - - A data descriptor also has the following optional keys: - - - `value` - - : The value associated with the property. Can be any valid JavaScript value - (number, object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `writable` - - : `true` if and only if the value associated with the property may be - changed with an assignment operator. - **Defaults to `false`.** - - An accessor descriptor also has the following optional keys: - - - `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no getter. The function's return value will be used as the value of - the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) - if there is no setter. The function will receive as its only argument the new - value being assigned to the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - - If a descriptor has neither of `value`, `writable`, - `get` and `set` keys, it is treated as a data descriptor. If a - descriptor has both `value` or `writable` and `get` - or `set` keys, an exception is thrown. - -### Return value - -The object that was passed to the function. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/defineProperty.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/defineProperty.mdx deleted file mode 100644 index a1f6c0fbb9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/defineProperty.mdx +++ /dev/null @@ -1,149 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.defineProperty() - -The static method **`Object.defineProperty()`** defines a new -property directly on an object, or modifies an existing property on an object, and -returns the object. - -## Syntax - -```js -Object.defineProperty(obj, prop, descriptor) -``` - -### Parameters - -- `obj` - - : The object on which to define the property. -- `prop` - - : The name or `Symbol` of the property to be defined or modified. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The object that was passed to the function. - -## Description - -This method allows a precise addition to or modification of a property on an object. -Normal property addition through assignment creates properties which show up during -property enumeration (`for...in` loop or -[`Object.keys`](../../globals/Object/keys.mdx) method), whose values may be changed, and which may be -deleted. This method allows these extra details -to be changed from their defaults. By default, properties added using -`Object.defineProperty()` are not writable, not enumerable, and not configurable. - -Property descriptors present in objects come in two main flavors: data descriptors and -accessor descriptors. A **data descriptor** is a property that has a -value, which may or may not be writable. An **accessor descriptor** is a -property described by a getter-setter pair of functions. A descriptor must be one of -these two flavors; it cannot be both. - -Both data and accessor descriptors are objects. They share the following optional keys -(please note: the **defaults** mentioned here are in the case of defining -properties using `Object.defineProperty()`): - -- `configurable` - - - : when this is set to `false`, - - - the type of this property cannot be changed between data property and accessor property, and - - the property may not be deleted, and - - other attributes of its descriptor cannot be changed (however, if it's a data descriptor with `writable: true`, the `value` can be changed, and `writable` can be changed to `false`). - - **Defaults to `false`.** - -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. - **Defaults to `false`.** - -A **data descriptor** also has the following optional keys: - -- `value` - - : The value associated with the property. Can be any valid JavaScript value (number, - object, function, etc.). - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `writable` - - : `true` if the value associated with the property may be changed with an - assignment operator. - **Defaults to `false`.** - -An **accessor descriptor** also has the following optional keys: - -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter. When the property is accessed, this function is called without - arguments and with `this` set to the object through which the property is - accessed (this may not be the object on which the property is defined due to - inheritance). The return value will be used as the value of the property. - **Defaults to [`undefined`](../../globals/undefined.mdx).** -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter. When the property is assigned, this function is called with one - argument (the value being assigned to the property) and with `this` set to - the object through which the property is assigned. - **Defaults to [`undefined`](../../globals/undefined.mdx).** - -If a descriptor has neither of `value`, `writable`, -`get` and `set` keys, it is treated as a data descriptor. If a -descriptor has both \[`value` or `writable`] and \[`get` or `set`] keys, an exception is thrown. - -Bear in mind that these attributes are not necessarily the descriptor's own properties. -Inherited properties will be considered as well. In order to ensure these defaults are -preserved, you might freeze existing objects in the descriptor object's prototype chain upfront, specify all -options explicitly, or point to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) with [`Object.create(null)`](../../globals/Object/create.mdx). - -```js -const obj = {}; -// 1. Using a null prototype: no inherited properties -const descriptor = Object.create(null); -descriptor.value = 'static'; - -// not enumerable, not configurable, not writable as defaults -Object.defineProperty(obj, 'key', descriptor); - -// 2. Being explicit by using a throw-away object literal with all attributes present -Object.defineProperty(obj, 'key2', { - enumerable: false, - configurable: false, - writable: false, - value: 'static' -}); - -// 3. Recycling same object -function withValue(value) { - const d = withValue.d || ( - withValue.d = { - enumerable: false, - writable: false, - configurable: false, - value, - } - ); - - // avoiding duplicate operation for assigning value - if (d.value !== value) d.value = value; - - return d; -} -// and -Object.defineProperty(obj, 'key', withValue('static')); - -// if freeze is available, prevents adding or -// removing the object prototype properties -// (value, get, set, enumerable, writable, configurable) -(Object.freeze || Object)(Object.prototype); -``` - -When the property already exists, `Object.defineProperty()` attempts to modify the property according to the values in the descriptor and the property's current configuration. - -If the old descriptor had its `configurable` attribute set to `false`, the property is said to be _non-configurable_. It is not possible to change any attribute of a non-configurable accessor property, and it is not possible to switch between data and accessor property types. For data properties with `writable: true`, it is possible to modify the value and change the `writable` attribute from `true` to `false`. A [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown when attempts are made to change non-configurable property attributes (except `value` and `writable`, if permitted), except when defining a value same as the original value on a data property. - -When the current property is configurable, defining an attribute to `undefined` effectively deletes it. For example, if `o.k` is an accessor property, `Object.defineProperty(o, "k", { set: undefined })` will remove the setter, making `k` only have a getter and become readonly. If an attribute is absent from the new descriptor, the old descriptor attribute's value is kept (it won't be implicitly re-defined to `undefined`). It is possible to toggle between data and accessor property by giving a descriptor of a different "flavor". For example, if the new descriptor is a data descriptor (with `value` or `writable`), the original descriptor's `get` and `set` attributes will both be dropped. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/entries.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/entries.mdx deleted file mode 100644 index 594508e6ab..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/entries.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.entries() - -The **`Object.entries()`** method returns an array of a given object's own enumerable string-keyed property key-value pairs. - -## Syntax - -```js -Object.entries(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of the given object's own enumerable string-keyed property key-value pairs. Each key-value pair is an array with two elements: the first element is the property key (which is always a string), and the second element is the property value. - -## Description - -`Object.entries()` returns an array whose elements are arrays corresponding to the enumerable string-keyed property key-value pairs found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.entries()` is the same as that provided by a `for...in` loop. - -If you only need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you only need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/freeze.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/freeze.mdx deleted file mode 100644 index bbaaa59cce..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/freeze.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.freeze() - -The **`Object.freeze()`** method _freezes_ an object. Freezing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-writable and non-configurable. A frozen object can no longer be changed: new properties cannot be added, existing properties cannot be removed, their enumerability, configurability, writability, or value cannot be changed, and the object's prototype cannot be re-assigned. `freeze()` returns the same object that was passed in. - -Freezing an object is the highest integrity level that JavaScript provides. - -## Syntax - -```js -Object.freeze(obj) -``` - -### Parameters - -- `obj` - - : The object to freeze. - -### Return value - -The object that was passed to the function. - -## Description - -Freezing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing [properties' descriptors'](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description) `configurable` to `false` — and for data properties, `writable` to `false` as well. Nothing can be added to or removed from the properties set of a frozen object. Any attempt to do so will fail, either silently or by throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx) exception (most commonly, but not exclusively, when in "strict mode"). - -For data properties of a frozen object, their values cannot be changed since the writable and -configurable attributes are set to false. Accessor properties (getters and setters) work the same — the property value returned by the getter may still change, and the setter can still be called without throwing errors when setting the property. Note that values -that are objects can still be modified, unless they are also frozen. As an object, an -array can be frozen; after doing so, its elements cannot be altered and no elements can -be added to or removed from the array. - -`freeze()` returns the same object that was passed into the function. It -_does not_ create a frozen copy. - -A `TypedArray` or a [`DataView`](../../globals/DataView/DataView.mdx) with elements will cause a [`TypeError`](../../globals/TypeError/TypeError.mdx), -as they are views over memory and will definitely cause other possible issues: - -```js -Object.freeze(new Uint8Array(0)) // No elements -// Uint8Array [] - -Object.freeze(new Uint8Array(1)) // Has elements -// TypeError: Cannot freeze array buffer views with elements - -Object.freeze(new DataView(new ArrayBuffer(32))) // No elements -// DataView {} - -Object.freeze(new Float64Array(new ArrayBuffer(64), 63, 0)) // No elements -// Float64Array [] - -Object.freeze(new Float64Array(new ArrayBuffer(64), 32, 2)) // Has elements -// TypeError: Cannot freeze array buffer views with elements -``` - -Note that as the standard three properties (`buf.byteLength`, -`buf.byteOffset` and `buf.buffer`) are read-only (as are those of -an `ArrayBuffer`, there is no reason for -attempting to freeze these properties. - -Unlike [`Object.seal()`](../../globals/Object/seal.mdx), existing properties in objects frozen with `Object.freeze()` are made immutable and data properties cannot be re-assigned. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/fromEntries.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/fromEntries.mdx deleted file mode 100644 index ee66f8f527..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/fromEntries.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.fromEntries() - -The **`Object.fromEntries()`** method transforms a list of key-value pairs into an object. - -## Syntax - -```js -Object.fromEntries(iterable) -``` - -### Parameters - -- `iterable` - - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol), such as an `Array` or [Map](../../globals/Map/Map.mdx), containing a list of objects. Each object should have two properties: - - - `0` - - : A string or `Symbol` representing the property key. - - `1` - - : The property value. - - Typically, this object is implemented as a two-element array, with the first element being the property key and the second element being the property value. - -### Return value - -A new object whose properties are given by the entries of the iterable. - -## Description - -The `Object.fromEntries()` method takes a list of key-value pairs and returns a new object whose properties are given by those entries. The `iterable` argument is expected to be an object that implements an `@@iterator` method. The method returns an iterator object that produces two-element array-like objects. The first element is a value that will be used as a property key, and the second element is the value to associate with that property key. - -`Object.fromEntries()` performs the reverse of [`Object.entries()`](../../globals/Object/entries.mdx), except that `Object.entries()` only returns string-keyed properties, while `Object.fromEntries()` can also create symbol-keyed properties. - -> **Note:** Unlike [`Array.from()`](../../globals/Array/from.mdx), `Object.fromEntries()` does not use the value of `this`, so calling it on another constructor does not create objects of that type. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertyDescriptor.mdx deleted file mode 100644 index d5871721cf..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptor() - -The **`Object.getOwnPropertyDescriptor()`** method returns an -object describing the configuration of a specific property on a given object (that is, -one directly present on an object and not in the object's prototype chain). The object -returned is mutable but mutating it has no effect on the original property's -configuration. - -## Syntax - -```js -Object.getOwnPropertyDescriptor(obj, prop) -``` - -### Parameters - -- `obj` - - : The object in which to look for the property. -- `prop` - - : The name or `Symbol` of the property whose description is to be - retrieved. - -### Return value - -A property descriptor of the given property if it exists on the object, -[`undefined`](../../globals/undefined.mdx) otherwise. - -## Description - -This method permits examination of the precise description of a property. A -_property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertyDescriptors.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertyDescriptors.mdx deleted file mode 100644 index cfe9c61c23..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertyDescriptors.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyDescriptors() - -The **`Object.getOwnPropertyDescriptors()`** method returns all -own property descriptors of a given object. - -## Syntax - -```js -Object.getOwnPropertyDescriptors(obj) -``` - -### Parameters - -- `obj` - - : The object for which to get all own property descriptors. - -### Return value - -An object containing all own property descriptors of an object. Might be an empty -object, if there are no properties. - -## Description - -This method permits examination of the precise description of all own properties of an -object. A _property_ in JavaScript consists of either a string-valued name or a -`Symbol` and a property descriptor. Further information about property -descriptor types and their attributes can be found in -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx). - -A _property descriptor_ is a record with some of the following attributes: - -- `value` - - : The value associated with the property (data descriptors only). -- `writable` - - : `true` if and only if the value associated with the property may be - changed (data descriptors only). -- `get` - - : A function which serves as a getter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no getter (accessor descriptors only). -- `set` - - : A function which serves as a setter for the property, or [`undefined`](../../globals/undefined.mdx) if - there is no setter (accessor descriptors only). -- `configurable` - - : `true` if and only if the type of this property descriptor may be changed - and if the property may be deleted from the corresponding object. -- `enumerable` - - : `true` if and only if this property shows up during enumeration of the - properties on the corresponding object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertyNames.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertyNames.mdx deleted file mode 100644 index b0995265ae..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertyNames.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertyNames() - -The **`Object.getOwnPropertyNames()`** method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found directly in a given object. - -## Syntax - -```js -Object.getOwnPropertyNames(obj) -``` - -### Parameters - -- `obj` - - : The object whose enumerable and non-enumerable properties are to be returned. - -### Return value - -An array of strings that corresponds to the properties found directly in the given object. - -## Description - -`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable and non-enumerable properties found directly in a given object `obj`. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by [`Object.keys()`](../../globals/Object/keys.mdx)) over the properties of the object. The non-negative integer keys of the object (both enumerable and non-enumerable) are added in ascending order to the array first, followed by the string keys in the order of insertion. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertySymbols.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertySymbols.mdx deleted file mode 100644 index 386c0e7773..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/getOwnPropertySymbols.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getOwnPropertySymbols() - -The **`Object.getOwnPropertySymbols()`** method returns an array of all symbol properties found directly upon a given object. - -## Syntax - -```js -Object.getOwnPropertySymbols(obj) -``` - -### Parameters - -- `obj` - - : The object whose symbol properties are to be returned. - -### Return value - -An array of all symbol properties found directly upon the given object. - -## Description - -Similar to [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx), you can get all symbol properties of a given object as an array of symbols. Note that [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) itself does not contain the symbol properties of an object and only the string properties. - -As all objects have no own symbol properties initially, `Object.getOwnPropertySymbols()` returns an empty array unless you have set symbol properties on your object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/getPrototypeOf.mdx deleted file mode 100644 index 81fc912bbe..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/getPrototypeOf.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.getPrototypeOf() - -The **`Object.getPrototypeOf()`** method returns the prototype -(i.e. the value of the internal `[[Prototype]]` property) of the specified -object. - -## Syntax - -```js -Object.getPrototypeOf(obj) -``` - -### Parameters - -- `obj` - - : The object whose prototype is to be returned. - -### Return value - -The prototype of the given object, which may be `null`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/hasOwn.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/hasOwn.mdx deleted file mode 100644 index 5444736c40..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/hasOwn.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.hasOwn() - -The **`Object.hasOwn()`** static method returns `true` if the specified object has the indicated property as its _own_ property. -If the property is inherited, or does not exist, the method returns `false`. - -> **Note:** `Object.hasOwn()` is intended as a replacement for [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx). - - - -## Syntax - -```js -hasOwn(instance, prop) -``` - -### Parameters - -- `instance` - - : The JavaScript object instance to test. -- `prop` - - : The `String` name or [Symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol) of the property to test. - -### Return value - -`true` if the specified object has directly defined the specified property. -Otherwise `false` - -## Description - -The **`Object.hasOwn()`** method returns `true` if the specified property is a -direct property of the object — even if the property value is `null` or `undefined`. -The method returns `false` if the property is inherited, or has not been declared at all. -Unlike the `in` operator, this -method does not check for the specified property in the object's prototype chain. - -It is recommended over [`Object.prototype.hasOwnProperty()`](../../globals/Object/prototype/hasOwnProperty.mdx) because -it works for objects created using `Object.create(null)` and with objects that -have overridden the inherited `hasOwnProperty()` method. While it is possible to -workaround these problems by calling `Object.prototype.hasOwnProperty()` on an -external object, `Object.hasOwn()` is more intuitive. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/is.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/is.mdx deleted file mode 100644 index 751e793ba4..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/is.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.is() - -The **`Object.is()`** method determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). - -## Syntax - -```js -Object.is(value1, value2) -``` - -### Parameters - -- `value1` - - : The first value to compare. -- `value2` - - : The second value to compare. - -### Return value - -A boolean indicating whether or not the two arguments are the same value. - -## Description - -`Object.is()` determines whether two values are [the same value](https://developer.mozilla.org/docs/Web/JavaScript/Equality_comparisons_and_sameness#same-value_equality_using_object.is). Two values are the same if one of the following holds: - -- both [`undefined`](../../globals/undefined.mdx) -- both `null` -- both `true` or both `false` -- both strings of the same length with the same characters in the same order -- both the same object (meaning both values reference the same object in memory) -- both `BigInts` with the same numeric value -- both `Symbols` that reference the same symbol value -- both numbers and - - - both `+0` - - both `-0` - - both [`NaN`](../../globals/NaN.mdx) - - or both non-zero, not [`NaN`](../../globals/NaN.mdx), and have the same value - -`Object.is()` is not equivalent to the [`==`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Equality) operator. The `==` operator applies various coercions to both sides (if they are not the same type) before testing for equality (resulting in such behavior as `"" == false` being `true`), but `Object.is()` doesn't coerce either value. - -`Object.is()` is also _not_ equivalent to the [`===`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Strict_equality) operator. The only difference between `Object.is()` and `===` is in their treatment of signed zeros and `NaN` values. The `===` operator (and the `==` operator) treats the number values `-0` and `+0` as equal, but treats [`NaN`](../../globals/NaN.mdx) as not equal to each other. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/isExtensible.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/isExtensible.mdx deleted file mode 100644 index 685026d65c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/isExtensible.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isExtensible() - -The **`Object.isExtensible()`** method determines if an object -is extensible (whether it can have new properties added to it). - -## Syntax - -```js -Object.isExtensible(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is extensible. - -## Description - -Objects are extensible by default: they can have new properties added to them, and their `[[Prototype]]` can be re-assigned. An object can be marked as non-extensible using one of [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), [`Object.seal()`](../../globals/Object/seal.mdx), [`Object.freeze()`](../../globals/Object/freeze.mdx), or [`Reflect.preventExtensions()`](../../globals/Reflect/preventExtensions.mdx). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/isFrozen.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/isFrozen.mdx deleted file mode 100644 index 52e1d9eecf..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/isFrozen.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isFrozen() - -The **`Object.isFrozen()`** determines if an object is -[frozen](../../globals/Object/freeze.mdx). - -## Syntax - -```js -Object.isFrozen(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is frozen. - -## Description - -An object is frozen if and only if it is not [extensible](../../globals/Object/isExtensible.mdx), all its properties are non-configurable, and all its data -properties (that is, properties which are not accessor properties with getter or setter -components) are non-writable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/isSealed.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/isSealed.mdx deleted file mode 100644 index f7996f6d0a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/isSealed.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.isSealed() - -The **`Object.isSealed()`** method determines if an object is -sealed. - -## Syntax - -```js -Object.isSealed(obj) -``` - -### Parameters - -- `obj` - - : The object which should be checked. - -### Return value - -A `Boolean` indicating whether or not the given object is sealed. - -## Description - -Returns `true` if the object is sealed, otherwise `false`. An -object is sealed if it is not [extensible](../../globals/Object/isExtensible.mdx) and -if all its properties are non-configurable and therefore not removable (but not -necessarily non-writable). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/keys.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/keys.mdx deleted file mode 100644 index 266389bab1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/keys.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.keys() - -The **`Object.keys()`** method returns an array of a given object's own enumerable string-keyed property names. - -## Syntax - -```js -Object.keys(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array of strings representing the given object's own enumerable string-keyed property keys. - -## Description - -`Object.keys()` returns an array whose elements are strings corresponding to the enumerable string-keyed property names found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.keys()` is the same as that provided by a `for...in` loop. - -If you need the property values, use [`Object.values()`](../../globals/Object/values.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/preventExtensions.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/preventExtensions.mdx deleted file mode 100644 index 348efc0c8c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/preventExtensions.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.preventExtensions() - -The **`Object.preventExtensions()`** method prevents new -properties from ever being added to an object (i.e. prevents future extensions to the -object). It also prevents the object's prototype from being re-assigned. - -## Syntax - -```js -Object.preventExtensions(obj) -``` - -### Parameters - -- `obj` - - : The object which should be made non-extensible. - -### Return value - -The object being made non-extensible. - -## Description - -An object is extensible if new properties can be added to it. -`Object.preventExtensions()` marks an object as no longer extensible, so that -it will never have properties beyond the ones it had at the time it was marked as -non-extensible. Note that the properties of a non-extensible object, in general, may -still be _deleted_. Attempting to add new properties to a non-extensible object -will fail, either silently or, in [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), throwing a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -Unlike [`Object.seal()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/seal) and [`Object.freeze()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze), `Object.preventExtensions()` invokes an intrinsic JavaScript behavior and cannot be replaced with a composition of several other operations. It also has its `Reflect` counterpart (which only exists for intrinsic operations), [`Reflect.preventExtensions()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Reflect/preventExtensions). - -`Object.preventExtensions()` only prevents addition of own properties. Properties can still be added to the object prototype. - -This method makes the `[[Prototype]]` of the target immutable; any `[[Prototype]]` re-assignment will throw a `TypeError`. This behavior is specific to the internal `[[Prototype]]` property; other properties of the target object will remain mutable. - -There is no way to make an object extensible again once it has been made non-extensible. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/constructor.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/constructor.mdx deleted file mode 100644 index fafba4d12d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/constructor.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.constructor - -The **`constructor`** data property of an `Object` instance returns a reference to the constructor function that created the instance object. Note that the value of this property is a reference to _the function itself_, not a string containing the function's name. - -> **Note:** This is a property of JavaScript objects. For the `constructor` method in classes, see [its own reference page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/constructor). - -## Value - -A reference to the constructor function that created the instance object. - -> **Note:** This property is created by default on the [`prototype`](../../../globals/Function/prototype/) property of every constructor function and is inherited by all objects created by that constructor. - -## Description - -Any object (with the exception of [`null` prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) will have a `constructor` property on its `[[Prototype]]`. Objects created with literals will also have a `constructor` property that points to the constructor type for that object — for example, array literals create `Array` objects, and [object literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Object_initializer) create plain objects. - -```js -const o1 = {}; -o1.constructor === Object; // true - -const o2 = new Object(); -o2.constructor === Object; // true - -const a1 = []; -a1.constructor === Array; // true - -const a2 = new Array(); -a2.constructor === Array; // true - -const n = 3; -n.constructor === Number; // true -``` - -Note that `constructor` usually comes from the constructor's [`prototype`](../../../globals/Function/prototype/) property. If you have a longer prototype chain, you can usually expect every object in the chain to have a `constructor` property. - -```js -const o = new TypeError(); // Inheritance: TypeError -> Error -> Object -const proto = Object.getPrototypeOf; -proto(o).constructor === TypeError; // true -proto(proto(o)).constructor === Error; // true -proto(proto(proto(o))).constructor === Object; // true -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/hasOwnProperty.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/hasOwnProperty.mdx deleted file mode 100644 index 9925dc7b55..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/hasOwnProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.hasOwnProperty() - -The **`hasOwnProperty()`** method returns a boolean indicating whether the -object has the specified property as its own property (as opposed to inheriting -it). - -> **Note:** [`Object.hasOwn()`](../../../globals/Object/hasOwn.mdx) is recommended over -> `hasOwnProperty()`, in browsers where it is supported. - -## Syntax - -```js -hasOwnProperty(prop) -``` - -### Parameters - -- `prop` - - : The `String` name or `Symbol` of the property to test. - -### Return value - -Returns `true` if the object has the specified property as own property; `false` -otherwise. - -## Description - -The **`hasOwnProperty()`** method returns `true` if the specified property is a -direct property of the object — even if the value is `null` or `undefined`. The -method returns `false` if the property is inherited, or has not been declared at -all. Unlike the `in` operator, this -method does not check for the specified property in the object's prototype -chain. - -The method can be called on _most_ JavaScript objects, because most objects -descend from `Object`, and hence inherit its methods. For -example `Array` is an `Object`, so you can -use `hasOwnProperty()` method to check whether an index exists: - -```js -const fruits = ['Apple', 'Banana','Watermelon', 'Orange']; -fruits.hasOwnProperty(3); // true ('Orange') -fruits.hasOwnProperty(4); // false - not defined -``` - -The method will not be available in objects where it is reimplemented, or on -objects created using `Object.create(null)` (as these don't inherit from -`Object.prototype`). Examples for these cases are given below. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/isPrototypeOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/isPrototypeOf.mdx deleted file mode 100644 index 1344f7bbc8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/isPrototypeOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.isPrototypeOf() - -The **`isPrototypeOf()`** method checks if an object exists in another object's prototype chain. - -> **Note:** `isPrototypeOf()` differs from the [`instanceof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/instanceof) operator. In the expression `object instanceof AFunction`, `object`'s prototype chain is checked against `AFunction.prototype`, not against `AFunction` itself. - -## Syntax - -```js -isPrototypeOf(object) -``` - -### Parameters - -- `object` - - : The object whose prototype chain will be searched. - -### Return value - -A boolean indicating whether the calling object (`this`) lies in the prototype chain of `object`. Directly returns `false` when `object` is not an object (i.e. a primitive). - -### Errors thrown - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if `this` is `null` or `undefined` (because it can't be [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)). - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `isPrototypeOf()` method. This method allows you to check whether or not the object exists within another object's prototype chain. If the `object` passed as the parameter is not an object (i.e. a primitive), the method directly returns `false`. Otherwise, the `this` value is [converted to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion), and the prototype chain of `object` is searched for the `this` value, until the end of the chain is reached or the `this` value is found. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/propertyIsEnumerable.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/propertyIsEnumerable.mdx deleted file mode 100644 index 487e300f20..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/propertyIsEnumerable.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.propertyIsEnumerable() - -The **`propertyIsEnumerable()`** method returns a boolean indicating whether the specified property is the object's [enumerable own](https://developer.mozilla.org/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) property. - -## Syntax - -```js -propertyIsEnumerable(prop) -``` - -### Parameters - -- `prop` - - : The name of the property to test. Can be a string or a `Symbol`. - -### Return value - -A boolean value indicating whether the specified property is enumerable and is the object's own property. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `propertyIsEnumerable()` method. This method determines if the specified property, string or symbol, is an enumerable own property of the object. If the object does not have the specified property, this method returns `false`. - -This method is equivalent to [`Object.getOwnPropertyDescriptor(obj, prop)?.enumerable ?? false`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/toLocaleString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/toLocaleString.mdx deleted file mode 100644 index ffa47cd767..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/toLocaleString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toLocaleString() - -The **`toLocaleString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for locale-specific purposes. - -## Syntax - -```js -toLocaleString() -``` - -### Parameters - -None. However, all objects that override this method are expected to accept at most two parameters, corresponding to `locales` and `options`, such as [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx). The parameter positions should not be used for any other purpose. - -### Return value - -The return value of calling `this.toString()`. - -## Description - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toLocaleString()` method. `Object`'s `toLocaleString` returns the result of calling [`this.toString()`](../../../globals/Object/prototype/toString.mdx). - -This function is provided to give objects a generic `toLocaleString` method, even though not all may use it. In the core language, these built-in objects override `toLocaleString` to provide locale-specific formatting: - -- `Array`: [`Array.prototype.toLocaleString()`](../../../globals/Array/prototype/toLocaleString.mdx) -- `Number`: [`Number.prototype.toLocaleString()`](../../../globals/Number/prototype/toLocaleString.mdx) -- `Date`: [`Date.prototype.toLocaleString()`](../../../globals/Date/prototype/toLocaleString.mdx) -- `BigInt`: [`BigInt.prototype.toLocaleString()`](../../../globals/BigInt/prototype/toLocaleString.mdx) diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/toString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/toString.mdx deleted file mode 100644 index 946e0ce728..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/toString.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.toString() - -The **`toString()`** method returns a string representing the object. This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - -## Syntax - -```js -toString() -``` - -### Parameters - -By default `toString()` takes no parameters. However, objects that inherit from `Object` may override it with their own implementations that do take parameters. For example, the [`Number.prototype.toString()`](../../../globals/Number/prototype/toString.mdx) and [`BigInt.prototype.toString()`](../../../globals/BigInt/prototype/toString.mdx) methods take an optional `radix` parameter. - -### Return value - -A string representing the object. - -## Description - -JavaScript calls the `toString` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `toString` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), but [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) call `valueOf()` in priority. However, because the base [`valueOf()`](../../../globals/Object/prototype/valueOf.mdx) method returns an object, the `toString()` method is usually called in the end, unless the object overrides `valueOf()`. For example, `+[1]` returns `1`, because its [`toString`](../../../globals/Array/prototype/toString.mdx) method returns `"1"`, which is then converted to a number. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. When you create a custom object, you can override `toString()` to call a custom method, so that your custom object can be converted to a string value. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. - -To use the base `Object.prototype.toString()` with an object that has it overridden (or to invoke it on `null` or `undefined`), you need to call [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) or [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) on it, passing the object you want to inspect as the first parameter (called `thisArg`). - -```js -const arr = [1, 2, 3]; - -arr.toString(); // "1,2,3" -Object.prototype.toString.call(arr); // "[object Array]" -``` - -`Object.prototype.toString()` returns `"[object Type]"`, where `Type` is the object type. If the object has a [`Symbol.toStringTag`](../../../globals/Symbol/toStringTag.mdx) property whose value is a string, that value will be used as the `Type`. Many built-in objects, including [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Symbol`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol), have a `Symbol.toStringTag`. Some objects predating ES6 do not have `Symbol.toStringTag`, but have a special tag nonetheless. They include (the tag is the same as the type name given below): - -- [`Array`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) -- [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions) (anything whose [`typeof`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof) returns `"function"`) -- [`Error`](../../../globals/Error/Error.mdx) -- [`Boolean`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) -- [`Number`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) -- [`String`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) -- [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) -- [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - -The [`arguments`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/arguments) object returns `"[object Arguments]"`. Everything else, including user-defined classes, unless with a custom `Symbol.toStringTag`, will return `"[object Object]"`. - -`Object.prototype.toString()` invoked on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) and [`undefined`](../../../globals/undefined.mdx) returns `[object Null]` and `[object Undefined]`, respectively. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/valueOf.mdx deleted file mode 100644 index 6c900d49e0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/prototype/valueOf.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.prototype.valueOf() - -The **`valueOf()`** method of `Object` converts the `this` value [to an object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion). This method is meant to be overridden by derived objects for custom [type conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) logic. - - - -## Syntax - -```js -valueOf() -``` - -### Parameters - -None. - -### Return value - -The `this` value, converted to an object. - -> **Note:** In order for `valueOf` to be useful during type conversion, it must return a primitive. Because all primitive types have their own `valueOf()` methods, calling `aPrimitiveValue.valueOf()` generally does not invoke `Object.prototype.valueOf()`. - -## Description - -JavaScript calls the `valueOf` method to [convert an object to a primitive value](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). You rarely need to invoke the `valueOf` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. - -This method is called in priority by [numeric conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) and [primitive conversion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion), but [string conversion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) calls `toString()` in priority, and `toString()` is very likely to return a string value (even for the [`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx) base implementation), so `valueOf()` is usually not called in this case. - -All objects that inherit from `Object.prototype` (that is, all except [`null`-prototype objects](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object#null-prototype_objects)) inherit the `toString()` method. The `Object.prototype.valueOf()` base implementation is deliberately useless: by returning an object, its return value will never be used by any [primitive conversion algorithm](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion). Many built-in objects override this method to return an appropriate primitive value. When you create a custom object, you can override `valueOf()` to call a custom method, so that your custom object can be converted to a primitive value. Generally, `valueOf()` is used to return a value that is most meaningful for the object — unlike `toString()`, it does not need to be a string. Alternatively, you can add a [`Symbol.toPrimitive`](../../../globals/Symbol/toPrimitive.mdx) method, which allows even more control over the conversion process, and will always be preferred over `valueOf` or `toString` for any type conversion. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/seal.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/seal.mdx deleted file mode 100644 index c91fa05d43..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/seal.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.seal() - -The **`Object.seal()`** method _seals_ an object. Sealing an object [prevents extensions](../../globals/Object/preventExtensions.mdx) and makes existing properties non-configurable. A sealed object has a fixed set of properties: new properties cannot be added, existing properties cannot be removed, their enumerability and configurability cannot be changed, and its prototype cannot be re-assigned. Values of existing properties can still be changed as long as they are writable. `seal()` returns the same object that was passed in. - -## Syntax - -```js -Object.seal(obj) -``` - -### Parameters - -- `obj` - - : The object which should be sealed. - -### Return value - -The object being sealed. - -## Description - -Sealing an object is equivalent to [preventing extensions](../../globals/Object/preventExtensions.mdx) and then changing all existing properties' descriptors to `configurable: false`. This has the effect of making the set of properties on the object fixed. Making all properties non-configurable -also prevents them from being converted from data properties to accessor properties and -vice versa, but it does not prevent the values of data properties from being changed. -Attempting to delete or add properties to a sealed object, or to convert a data property -to accessor or vice versa, will fail, either silently or by throwing a -[`TypeError`](../../globals/TypeError/TypeError.mdx) (most commonly, although not exclusively, when in "strict mode" code). - -The prototype chain remains untouched. However, due to the effect of [preventing extensions](../../globals/Object/preventExtensions.mdx), the `[[Prototype]]` cannot be reassigned. - -Unlike [`Object.freeze()`](../../globals/Object/freeze.mdx), objects sealed with `Object.seal()` may have their existing -properties changed, as long as they are writable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/setPrototypeOf.mdx deleted file mode 100644 index bacad49a46..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/setPrototypeOf.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.setPrototypeOf() - -The **`Object.setPrototypeOf()`** method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -> **Warning:** Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines optimize property accesses, currently a very slow operation in every browser and JavaScript engine. In addition, the effects of altering inheritance are subtle and far-flung, and are not limited to the time spent in the `Object.setPrototypeOf(...)` statement, but may extend to **_any_** code that has access to any object whose `[[Prototype]]` has been altered. You can read more in [JavaScript engine fundamentals: optimizing prototypes](https://mathiasbynens.be/notes/prototypes). -> -> Because this feature is a part of the language, it is still the burden on engine developers to implement that feature performantly (ideally). Until engine developers address this issue, if you are concerned about performance, you should avoid setting the `[[Prototype]]` of an object. Instead, create a new object with the desired `[[Prototype]]` using [`Object.create()`](../../globals/Object/create.mdx). - -## Syntax - -```js -Object.setPrototypeOf(obj, prototype) -``` - -### Parameters - -- `obj` - - : The object which is to have its prototype set. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -The specified object. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if one of the following conditions is met: - - The `obj` parameter is [non-extensible](../../globals/Object/isExtensible.mdx), or it's an [immutable prototype exotic object](https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects), such as `Object.prototype`. - - The `prototype` parameter is not an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -`Object.setPrototypeOf()` is generally considered the proper way to set the prototype of an object. - -If the `obj` parameter is not an object (e.g. number, string, etc.), this method does nothing. - -For security concerns, there are certain built-in objects that are designed to have an _immutable prototype_. This prevents prototype pollution attacks, especially [proxy-related ones](https://github.com/tc39/ecma262/issues/272). The core language only specifies `Object.prototype` as an immutable prototype exotic object, whose prototype is always `null`. - -```js -Object.isExtensible(Object.prototype); // true; you can add more properties -Object.setPrototypeOf(Object.prototype, {}); // TypeError: Immutable prototype object '#' cannot have their prototype set -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/Object/values.mdx b/documentation/versioned_docs/version-3.9.0/globals/Object/values.mdx deleted file mode 100644 index 59c362f8c9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Object/values.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Object.values() - -The **`Object.values()`** method returns an array of a given object's own enumerable string-keyed property values. - -## Syntax - -```js -Object.values(obj) -``` - -### Parameters - -- `obj` - - : An object. - -### Return value - -An array containing the given object's own enumerable string-keyed property values. - -## Description - -`Object.values()` returns an array whose elements are strings corresponding to the enumerable string-keyed property values found directly upon `object`. This is the same as iterating with a `for...in` loop, except that a `for...in` loop enumerates properties in the prototype chain as well. The order of the array returned by `Object.values()` is the same as that provided by a `for...in` loop. - -If you need the property keys, use [`Object.keys()`](../../globals/Object/keys.mdx) instead. If you need both the property keys and values, use [`Object.entries()`](../../globals/Object/entries.mdx) instead. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Promise/@@species.mdx b/documentation/versioned_docs/version-3.9.0/globals/Promise/@@species.mdx deleted file mode 100644 index aa22b0bbaf..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Promise/@@species.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Promise[Symbol.species] - -The **`Promise[Symbol.species]`** accessor property returns the constructor used to construct return values from promise methods. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Syntax - -```js -Promise[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct return values from promise chaining methods that create new promises. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Promise` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically: - -```js -// Hypothetical underlying implementation for illustration -class Promise { - static get [Symbol.species]() { - return this; - } -} -``` - -Because of this polymorphic implementation, `Symbol.species` of derived subclasses would also return the constructor itself by default. - -```js -class SubPromise extends Promise {} -SubPromise[Symbol.species] === Promise; // true -``` - -Promise chaining methods — [`then()`](../../globals/Promise/prototype/then.mdx), [`finally()`](../../globals/Promise/prototype/finally.mdx) — return new promise objects. They get the constructor to construct the new promise through `this.constructor[Symbol.species]`. If `this.constructor` is `undefined`, or if `this.constructor[Symbol.species]` is `undefined` or `null`, the default [`Promise()`](../../globals/Promise/Promise.mdx) constructor is used. Otherwise, the constructor returned by `this.constructor[Symbol.species]` is used to construct the new promise object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Promise/Promise.mdx b/documentation/versioned_docs/version-3.9.0/globals/Promise/Promise.mdx deleted file mode 100644 index 68aeaf568f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Promise/Promise.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise() - -The **`Promise()`** constructor is primarily used to wrap functions that do not already support promises. - -## Syntax - -```js -new Promise(executor) -``` - -> **Note:** `Promise()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `executor` - - : A `function` to be executed by the constructor. It receives two functions as parameters: `resolveFunc` and `rejectFunc`. Any errors thrown in the `executor` will cause the promise to be rejected, and the return value will be neglected. The semantics of `executor` are detailed below. - -### Return value - -When called via `new`, the `Promise` constructor returns a promise object. The promise object will become _resolved_ when either of the functions `resolveFunc` or `rejectFunc` are invoked. Note that if you call `resolveFunc` or `rejectFunc` and pass another `Promise` object as an argument, it can be said to be "resolved", but still not "settled". See the [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for more explanation. - -## Description - -Traditionally (before promises), asynchronous tasks were designed as callbacks. - -```js -readFile("./data.txt", (error, result) => { - // This callback will be called when the task is done, with the - // final `error` or `result`. Any operation dependent on the - // result must be defined within this callback. -}); -// Code here is immediately executed after the `readFile` request -// is fired. It does not wait for the callback to be called, hence -// making `readFile` "asynchronous". -``` - -To take advantage of the readability improvement and language features offered by promises, the `Promise()` constructor allows one to transform the callback-based API to a promise-based one. - -> **Note:** If your task is already promise-based, you likely do not need the `Promise()` constructor. - -The `executor` is custom code that ties an outcome in a callback to a promise. You, the programmer, write the `executor`. Its signature is expected to be: - -```js -function executor(resolveFunc, rejectFunc) { - // Typically, some asynchronous operation that accepts a callback, - // like the `readFile` function above -} -``` - -`resolveFunc` and `rejectFunc` are also functions, and you can give them whatever actual names you want. Their signatures are simple: they accept a single parameter of any type. - -```js -resolveFunc(value); // call on resolved -rejectFunc(reason); // call on rejected -``` - -The `value` parameter passed to `resolveFunc` can be another promise object, in which case the newly constructed promise's state will be "locked in" to the promise passed (as part of the [resolution](#resolver_function) promise). The `rejectFunc` has semantics close to the [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statement, so `reason` is typically an [`Error`](../../globals/Error/Error.mdx) instance. If either `value` or `reason` is omitted, the promise is fulfilled/rejected with `undefined`. - -The `executor`'s completion state has limited effect on the promise's state: - -- The `executor` return value is ignored. `return` statements within the `executor` merely impact control flow and alter whether a part of the function is executed, but do not have any impact on the promise's fulfillment value. If `executor` exits and it's impossible for `resolveFunc` or `rejectFunc` to be called in the future (for example, there are no async tasks scheduled), then the promise remains pending forever. -- If an error is thrown in the `executor`, the promise is rejected, unless `resolveFunc` or `rejectFunc` has already been called. - -> **Note:** The existence of pending promises does not prevent the program from exiting. If the event loop is empty, the program exits despite any pending promises (because those are necessarily forever-pending). - -Here's a summary of the typical flow: - -1. At the time when the constructor generates the new `Promise` object, it also generates a corresponding pair of functions for `resolveFunc` and `rejectFunc`; these are "tethered" to the `Promise` object. -2. `executor` typically wraps some asynchronous operation which provides a callback-based API. The callback (the one passed to the original callback-based API) is defined within the `executor` code, so it has access to the `resolveFunc` and `rejectFunc`. -3. The `executor` is called synchronously (as soon as the `Promise` is constructed) with the `resolveFunc` and `rejectFunc` functions as arguments. -4. The code within the `executor` has the opportunity to perform some operation. The eventual completion of the asynchronous task is communicated with the promise instance via the side effect caused by `resolveFunc` or `rejectFunc`. The side effect is that the `Promise` object becomes "resolved". - - If `resolveFunc` is called first, the value passed will be [resolved](#resolver_function). The promise may stay pending (in case another [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) is passed), become fulfilled (in most cases where a non-thenable value is passed), or become rejected (in case of an invalid resolution value). - - If `rejectFunc` is called first, the promise instantly becomes rejected. - - Once one of the resolving functions (`resolveFunc` or `rejectFunc`) is called, the promise stays resolved. Only the first call to `resolveFunc` or `rejectFunc` affects the promise's eventual state, and subsequent calls to either function can neither change the fulfillment value/rejection reason nor toggle its eventual state from "fulfilled" to "rejected" or opposite. - - If `executor` exits by throwing an error, then the promise is rejected. However, the error is ignored if one of the resolving functions has already been called (so that the promise is already resolved). - - Resolving the promise does not necessarily cause the promise to become fulfilled or rejected (i.e. settled). The promise may still be pending because it's resolved with another thenable, but its eventual state will match that of the resolved thenable. -5. Once the promise settles, it (asynchronously) invokes any further handlers associated through [`Promise.prototype.then`](../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../globals/Promise/prototype/finally.mdx). The eventual fulfillment value or rejection reason is passed to the invocation of fulfillment and rejection handlers as an input parameter (see [Chained Promises](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#chained_promises)). - -For example, the callback-based `readFile` API above can be transformed into a promise-based one. - -```js -const readFilePromise = (path) => - new Promise((resolve, reject) => { - readFile(path, (error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - }); - -readFilePromise("./data.txt") - .then((result) => console.log(result)) - .catch((error) => console.error("Failed to read data")); -``` - -### Resolver function - -The resolver function `resolveFunc` has the following behaviors: - -- If it's called with the same value as the newly created promise (the promise it's "tethered to"), the promise is rejected with a [`TypeError`](../../globals/TypeError/TypeError.mdx). -- If it's called with a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value (a primitive, or an object whose `then` property is not callable, including when the property is not present), the promise is immediately fulfilled with that value. -- If it's called with a thenable value (including another `Promise` instance), then the thenable's `then` method is saved and called in the future (it's always called asynchronously). The `then` method will be called with two callbacks, which are two new functions with the exact same behaviors as the `resolveFunc` and `rejectFunc` passed to the `executor` function. If calling the `then` method throws, then the current promise is rejected with the thrown error. - -In the last case, it means code like: - -```js -new Promise((resolve, reject) => { - resolve(thenable); -}); -``` - -Is roughly equivalent to: - -```js -new Promise((resolve, reject) => { - try { - thenable.then( - (value) => resolve(value), - (reason) => reject(reason), - ); - } catch (e) { - reject(e); - } -}); -``` - -Except that in the `resolve(thenable)` case: - -1. `resolve` is called synchronously, so that calling `resolve` or `reject` again has no effect, even when the handlers attached through `anotherPromise.then()` are not called yet. -2. The `then` method is called asynchronously, so that the promise will never be instantly resolved if a thenable is passed. - -Because `resolve` is called again with whatever `thenable.then()` passes to it as `value`, the resolver function is able to flatten nested thenables, where a thenable calls its `onFulfilled` handler with another thenable. The effect is that the fulfillment handler of a real promise will never receive a thenable as its fulfillment value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Promise/all.mdx b/documentation/versioned_docs/version-3.9.0/globals/Promise/all.mdx deleted file mode 100644 index 1d7912d11f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Promise/all.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.all() - -The **`Promise.all()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises fulfill (including when an empty iterable is passed), with an array of the fulfillment values. It rejects when any of the input's promises rejects, with this first rejection reason. - -## Syntax - -```js -Promise.all(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all the promises in the given `iterable` fulfill. The fulfillment value is an array of fulfillment values, in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. -- **Asynchronously rejected**, when any of the promises in the given `iterable` rejects. The rejection reason is the rejection reason of the first promise that was rejected. - -## Description - -The `Promise.all()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It can be useful for aggregating the results of multiple promises. It is typically used when there are multiple related asynchronous tasks that the overall code relies on to work successfully — all of whom we want to fulfill before the code execution continues. - -`Promise.all()` will reject immediately upon **any** of the input promises rejecting. In comparison, the promise returned by [`Promise.allSettled()`](../../globals/Promise/allSettled.mdx) will wait for all input promises to complete, regardless of whether or not one rejects. Use `allSettled()` if you need the final result of every promise in the input iterable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Promise/allSettled.mdx b/documentation/versioned_docs/version-3.9.0/globals/Promise/allSettled.mdx deleted file mode 100644 index 0794ba102f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Promise/allSettled.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.allSettled() - -The **`Promise.allSettled()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when all of the input's promises settle (including when an empty iterable is passed), with an array of objects that describe the outcome of each promise. - -## Syntax - -```js -Promise.allSettled(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already fulfilled**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when all promise in the given `iterable` have settled (either fulfilled or rejected). The fulfillment value is an array of objects, each describing the outcome of one promise in the `iterable`, in the order of the promises passed, regardless of completion order. Each outcome object has the following properties: - - - `status` - - : A string, either `"fulfilled"` or `"rejected"`, indicating the eventual state of the promise. - - `value` - - : Only present if `status` is `"fulfilled"`. The value that the promise was fulfilled with. - - `reason` - - : Only present if `status` is `"rejected"`. The reason that the promise was rejected with. - - If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) fulfilled. - -## Description - -The `Promise.allSettled()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. `Promise.allSettled()` is typically used when you have multiple asynchronous tasks that are not dependent on one another to complete successfully, or you'd always like to know the result of each promise. - -In comparison, the Promise returned by [`Promise.all()`](../../globals/Promise/all.mdx) may be more appropriate if the tasks are dependent on each other, or if you'd like to immediately reject upon any of them rejecting. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Promise/any.mdx b/documentation/versioned_docs/version-3.9.0/globals/Promise/any.mdx deleted file mode 100644 index 1358ea41a3..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Promise/any.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.any() - -The **`Promise.any()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise fulfills when any of the input's promises fulfills, with this first fulfillment value. It rejects when all of the input's promises reject (including when an empty iterable is passed), with an `AggregateError` containing an array of rejection reasons. - -## Syntax - -```js -Promise.any(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array` of promises. - -### Return value - -A `Promise` that is: - -- **Already rejected**, if the `iterable` passed is empty. -- **Asynchronously fulfilled**, when any of the promises in the given `iterable` fulfills. The fulfillment value is the fulfillment value of the first promise that was fulfilled. -- **Asynchronously rejected**, when all of the promises in the given `iterable` reject. The rejection reason is an `AggregateError` containing an array of rejection reasons in its `errors` property. The errors are in the order of the promises passed, regardless of completion order. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) rejected. - -## Description - -The `Promise.any()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. This method is useful for returning the first promise that fulfills. It short-circuits after a promise fulfills, so it does not wait for the other promises to complete once it finds one. - -Unlike [`Promise.all()`](../../globals/Promise/all.mdx), which returns an _array_ of fulfillment values, we only get one fulfillment value (assuming at least one promise fulfills). This can be beneficial if we need only one promise to fulfill but we do not care which one does. Note another difference: this method rejects upon receiving an _empty iterable_, since, truthfully, the iterable contains no items that fulfill. You may compare `Promise.any()` and `Promise.all()` with [`Array.prototype.some()`](../../globals/Array/prototype/some.mdx) and [`Array.prototype.every()`](../../globals/Array/prototype/every.mdx). - -Also, unlike [`Promise.race()`](../../globals/Promise/race.mdx), which returns the first _settled_ value (either fulfillment or rejection), this method returns the first _fulfilled_ value. This method ignores all rejected promises up until the first promise that fulfills. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Promise/prototype/catch.mdx b/documentation/versioned_docs/version-3.9.0/globals/Promise/prototype/catch.mdx deleted file mode 100644 index 516c2949a7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Promise/prototype/catch.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.catch() - -The **`catch()`** method of a `Promise` object schedules a function to be called when the promise is rejected. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. It is a shortcut for [`Promise.prototype.then(undefined, onRejected)`](../../../globals/Promise/prototype/then.mdx). - -## Syntax - -```js -catch(onRejected) - -catch((reason) => { - // rejection handler -}) -``` - -### Parameters - -- `onRejected` - - : A `Function` called when the `Promise` is rejected. This function has one parameter: the _rejection reason_. - -### Return value - -Returns a new `Promise`. This new promise is always pending when returned, regardless of the current promise's status. It's eventually rejected if `onRejected` throws an error or returns a Promise which is itself rejected; otherwise, it's eventually fulfilled. - -## Description - -The `catch` method is used for error handling in promise composition. Since it returns a `Promise`, it [can be chained](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining_after_a_catch) in the same way as its sister method, [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx). - -If a promise becomes rejected, and there are no rejection handlers to call (a handler can be attached through any of [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx), [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx), or [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx)), then the rejection event is surfaced by the host. In the browser, this results in an [`unhandledrejection`](https://developer.mozilla.org/docs/Web/API/Window/unhandledrejection_event) event. If a handler is attached to a rejected promise whose rejection has already caused an unhandled rejection event, then another [`rejectionhandled`](https://developer.mozilla.org/docs/Web/API/Window/rejectionhandled_event) event is fired. - -`catch()` internally calls `then()` on the object upon which it was called, passing `undefined` and `onRejected` as arguments. The value of that call is directly returned. This is observable if you wrap the methods. - -```js -// overriding original Promise.prototype.then/catch just to add some logs -((Promise) => { - const originalThen = Promise.prototype.then; - const originalCatch = Promise.prototype.catch; - - Promise.prototype.then = function (...args) { - console.log("Called .then on %o with arguments: %o", this, args); - return originalThen.apply(this, args); - }; - Promise.prototype.catch = function (...args) { - console.error("Called .catch on %o with arguments: %o", this, args); - return originalCatch.apply(this, args); - }; -})(Promise); - -// calling catch on an already resolved promise -Promise.resolve().catch(function XXX() {}); - -// Logs: -// Called .catch on Promise{} with arguments: Arguments{1} [0: function XXX()] -// Called .then on Promise{} with arguments: Arguments{2} [0: undefined, 1: function XXX()] -``` - -This means that passing `undefined` still causes the returned promise to be rejected, and you have to pass a function to prevent the final promise from being rejected. - -Because `catch()` just calls `then()`, it supports subclassing. - -> **Note:** The examples below are throwing instances of [`Error`](../../../globals/Error/Error.mdx). As with synchronous [`throw`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/throw) statements, this is considered a good practice; otherwise, the part doing the catching would have to perform checks to see if the argument was a string or an error, and you might lose valuable information such as stack traces. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Promise/prototype/finally.mdx b/documentation/versioned_docs/version-3.9.0/globals/Promise/prototype/finally.mdx deleted file mode 100644 index 715028f5de..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Promise/prototype/finally.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.finally() - -The **`finally()`** method of a `Promise` object schedules a function to be called when the promise is settled (either fulfilled or rejected). It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -This lets you avoid duplicating code in both the promise's [`Promise.prototype.then`](../../../globals/Promise/prototype/then.mdx) and [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) handlers. - -## Syntax - -```js -finally(onFinally) - -finally(() => { - // Code that will run after promise is settled (fulfilled or rejected) -}) -``` - -### Parameters - -- `onFinally` - - : A `Function` called when the `Promise` is settled. This handler receives no parameters. - -### Return value - -Returns an equivalent `Promise`. If the handler throws an error or returns a rejected promise, the promise returned by `finally()` will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise. - -## Description - -The `finally()` method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. - -The `finally()` method is very similar to calling [`then(onFinally, onFinally)`](../../../globals/Promise/prototype/then.mdx). However, there are a couple of differences: - -- When creating a function inline, you can pass it once, instead of being forced to either declare it twice, or create a variable for it. -- The `onFinally` callback does not receive any argument. This use case is for precisely when you _do not care_ about the rejection reason or the fulfillment value, and so there's no need to provide it. -- A `finally()` call is usually transparent and does not change the eventual state of the original promise. So for example: - - Unlike `Promise.resolve(2).then(() => 77, () => {})`, which returns a promise eventually fulfilled with the value `77`, `Promise.resolve(2).finally(() => 77)` returns a promise eventually fulfilled with the value `2`. - - Similarly, unlike `Promise.reject(3).then(() => {}, () => 88)`, which returns a promise eventually fulfilled with the value `88`, `Promise.reject(3).finally(() => 88)` returns a promise eventually rejected with the reason `3`. - -> **Note:** A `throw` (or returning a rejected promise) in the `finally` callback still rejects the returned promise. For example, both `Promise.reject(3).finally(() => { throw 99; })` and `Promise.reject(3).finally(() => Promise.reject(99))` reject the returned promise with the reason `99`. - -Like [`Promise.prototype.catch()`](../../../globals/Promise/prototype/catch.mdx), `finally()` internally calls the `then` method on the object upon which it was called. If `onFinally` is not a function, `then()` is called with `onFinally` as both arguments — which, for [`Promise.prototype.then()`](../../../globals/Promise/prototype/then.mdx), means that no useful handler is attached. Otherwise, `then()` is called with two internally created functions, which behave like the following: - -> **Warning:** This is only for demonstration purposes and is not a polyfill. - -```js -promise.then( - (value) => Promise.resolve(onFinally()).then(() => value), - (reason) => - Promise.resolve(onFinally()).then(() => { - throw reason; - }), -); -``` - -Because `finally()` calls `then()`, it supports subclassing. Moreover, notice the [`Promise.resolve()`](../../../globals/Promise/resolve.mdx) call above — in reality, `onFinally()`'s return value is resolved using the same algorithm as `Promise.resolve()`, but the actual constructor used to construct the resolved promise will be the subclass. `finally()` gets this constructor through [`promise.constructor[Symbol.species]`](../../../globals/Promise/@@species.mdx). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Promise/prototype/then.mdx b/documentation/versioned_docs/version-3.9.0/globals/Promise/prototype/then.mdx deleted file mode 100644 index 74787b12ac..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Promise/prototype/then.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.prototype.then() - -The **`then()`** method of a `Promise` object takes up to two arguments: callback functions for the fulfilled and rejected cases of the `Promise`. It immediately returns an equivalent `Promise` object, allowing you to [chain](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Using_promises#chaining) calls to other promise methods. - -## Syntax - -```js -then(onFulfilled) -then(onFulfilled, onRejected) - -then( - (value) => { /* fulfillment handler */ }, - (reason) => { /* rejection handler */ }, -) -``` - -### Parameters - -- `onFulfilled` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is fulfilled. This function has one parameter, the _fulfillment value_. If it is not a function, it is internally replaced with an _identity_ function (`(x) => x`) which simply passes the fulfillment value forward. -- `onRejected` _**optional**_ - - : A `Function` asynchronously called if the `Promise` is rejected. This function has one parameter, the _rejection reason_. If it is not a function, it is internally replaced with a _thrower_ function (`(x) => { throw x; }`) which throws the rejection reason it received. - -### Return value - -Returns a new `Promise` immediately. This new promise is always pending when returned, regardless of the current promise's status. - -One of the `onFulfilled` and `onRejected` handlers will be executed to handle the current promise's fulfillment or rejection. The call always happens asynchronously, even when the current promise is already settled. The behavior of the returned promise (call it `p`) depends on the handler's execution result, following a specific set of rules. If the handler function: - -- returns a value: `p` gets fulfilled with the returned value as its value. -- doesn't return anything: `p` gets fulfilled with `undefined`. -- throws an error: `p` gets rejected with the thrown error as its value. -- returns an already fulfilled promise: `p` gets fulfilled with that promise's value as its value. -- returns an already rejected promise: `p` gets rejected with that promise's value as its value. -- returns another pending promise: the fulfillment/rejection of the promise returned by `then` will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the resolved value of the promise returned by `then` will be the same as the resolved value of the promise returned by the handler. - -## Description - -The `then()` method schedules callback functions for the eventual completion of a Promise — either fulfillment or rejection. It is the primitive method of promises: the [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) protocol expects all promise-like objects to expose a `then()` method, and the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) and [`Promise.prototype.finally`](../../../globals/Promise/prototype/finally.mdx) methods both work by invoking the object's `then()` method. - -For more information about the `onRejected` handler, see the [`Promise.prototype.catch`](../../../globals/Promise/prototype/catch.mdx) reference. - -`then()` returns a new promise object. If you call the `then()` method twice on the same promise object (instead of chaining), then this promise object will have two pairs of settlement handlers. All handlers attached to the same promise object are always called in the order they were added. Moreover, the two promises returned by each call of `then()` start separate chains and do not wait for each other's settlement. - -[Thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) objects that arise along the `then()` chain are always [resolved](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) — the `onFulfilled` handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is because when constructing the new promise, the `resolve` and `reject` functions passed by the `executor` are saved, and when the current promise settles, the respective function will be called with the fulfillment value or rejection reason. The resolving logic comes from the resolver function passed by the [`Promise()`](../../../globals/Promise/Promise.mdx) constructor. - -`then()` supports subclassing, which means it can be called on instances of subclasses of `Promise`, and the result will be a promise of the subclass type. You can customize the type of the return value through the [`[Symbol.species]`](../../../globals/Promise/@@species.mdx) property. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Promise/race.mdx b/documentation/versioned_docs/version-3.9.0/globals/Promise/race.mdx deleted file mode 100644 index d436d83658..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Promise/race.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.race() - -The **`Promise.race()`** method takes an iterable of promises as input and returns a single `Promise`. This returned promise settles with the eventual state of the first promise that settles. - -## Syntax - -```js -Promise.race(iterable) -``` - -### Parameters - -- `iterable` - - : An [iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) (such as an `Array`) of promises. - -### Return value - -A `Promise` that **asynchronously settles** with the eventual state of the first promise in the `iterable` to settle. In other words, it fulfills if the first promise to settle is fulfilled, and rejects if the first promise to settle is rejected. The returned promise remains pending forever if the `iterable` passed is empty. If the `iterable` passed is non-empty but contains no pending promises, the returned promise is still asynchronously (instead of synchronously) settled. - -## Description - -The `Promise.race()` method is one of the [promise concurrency](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#promise_concurrency) methods. It's useful when you want the first async task to complete, but do not care about its eventual state (i.e. it can either succeed or fail). - -If the iterable contains one or more non-promise values and/or an already settled promise, then `Promise.race()` will settle to the first of these values found in the iterable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Promise/reject.mdx b/documentation/versioned_docs/version-3.9.0/globals/Promise/reject.mdx deleted file mode 100644 index 7d1720fa67..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Promise/reject.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.reject() - -The **`Promise.reject()`** method returns a `Promise` object that is rejected with a given reason. - -## Syntax - -```js -Promise.reject(reason) -``` - -### Parameters - -- `reason` - - : Reason why this `Promise` rejected. - -### Return value - -A `Promise` that is rejected with the given reason. - -## Description - -The static `Promise.reject` function returns a `Promise` that is rejected. For debugging purposes and selective error catching, it is useful to make `reason` an `instanceof` [`Error`](../../globals/Error/Error.mdx). - -`Promise.reject()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. `Promise.reject()` is essentially a shorthand for `new Promise((resolve, reject) => reject(reason))`. - -Unlike [`Promise.resolve()`](../../globals/Promise/resolve.mdx), `Promise.reject()` always wraps `reason` in a new `Promise` object, even when `reason` is already a `Promise`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Promise/resolve.mdx b/documentation/versioned_docs/version-3.9.0/globals/Promise/resolve.mdx deleted file mode 100644 index 585fa2c90e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Promise/resolve.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Promise.resolve() - -The **`Promise.resolve()`** method "resolves" a given value to a `Promise`. If the value is a promise, that promise is returned; if the value is a [thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables), `Promise.resolve()` will call the `then()` method with two callbacks it prepared; otherwise the returned promise will be fulfilled with the value. - -This function flattens nested layers of promise-like objects (e.g. a promise that fulfills to a promise that fulfills to something) into a single layer — a promise that fulfills to a non-thenable value. - -## Syntax - -```js -Promise.resolve(value) -``` - -### Parameters - -- `value` - - : Argument to be resolved by this `Promise`. Can also be a `Promise` or a thenable to resolve. - -### Return value - -A `Promise` that is resolved with the given value, or the promise passed as value, if the value was a promise object. A resolved promise can be in any of the states — fulfilled, rejected, or pending. For example, resolving a rejected promise will still result in a rejected promise. - -## Description - -`Promise.resolve()` _resolves_ a promise, which is not the same as fulfilling or rejecting the promise. See [Promise description](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#description) for definitions of the terminology. In brief, `Promise.resolve()` returns a promise whose eventual state depends on another promise, thenable object, or other value. - -`Promise.resolve()` is generic and supports subclassing, which means it can be called on subclasses of `Promise`, and the result will be a promise of the subclass type. To do so, the subclass's constructor must implement the same signature as the [`Promise()`](../../globals/Promise/Promise.mdx) constructor — accepting a single `executor` function that can be called with the `resolve` and `reject` callbacks as parameters. - -`Promise.resolve()` special-cases native `Promise` instances. If `value` belongs to `Promise` or a subclass, and `value.constructor === Promise`, then `value` is directly returned by `Promise.resolve()`, without creating a new `Promise` instance. Otherwise, `Promise.resolve()` is essentially a shorthand for `new Promise((resolve) => resolve(value))`. - -The bulk of the resolving logic is actually implemented by the [resolver function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise#resolver_function) passed by the `Promise()` constructor. In summary: - -- If a non-[thenable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables) value is passed, the returned promise is already fulfilled with that value. -- If a thenable is passed, the returned promise will adopt the state of that thenable by calling the `then` method and passing a pair of resolving functions as arguments. (But because native promises directly pass through `Promise.resolve()` without creating a wrapper, the `then` method is not called on native promises.) If the resolver function receives another thenable object, it will be resolved agin, so that the eventual fulfillment value of the promise will never be thenable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/Proxy.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/Proxy.mdx deleted file mode 100644 index 2b96dd6a36..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/Proxy.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy() - -The **`Proxy()`** constructor is used to create `Proxy` objects. - -## Syntax - -```js -new Proxy(target, handler) -``` - -> **Note:** `Proxy()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, - including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions that define the behavior of the proxy when - an operation is performed on it. - -## Description - -Use the `Proxy()` constructor to create a new `Proxy` object. -This constructor takes two mandatory arguments: - -- `target` is the object for which you want to create the proxy -- `handler` is the object that defines the custom behavior of the proxy. - -An empty handler will create a proxy that behaves, in almost all respects, exactly like -the target. By defining any of a set group of functions on the `handler` -object, you can customize specific aspects of the proxy's behavior. For example, by -defining `get()` you can provide a customized version of the target's -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors). - -### Handler functions - -This section lists all the handler functions you can define. Handler functions are -sometimes called _traps_, because they trap calls to the underlying target -object. - -- [`handler.apply()`](../../globals/Proxy/proxy/apply.mdx) - - : A trap for a function call. -- [`handler.construct()`](../../globals/Proxy/proxy/construct.mdx) - - : A trap for the `new` operator. -- [`handler.defineProperty()`](../../globals/Proxy/proxy/defineProperty.mdx) - - : A trap for [`Object.defineProperty`](../../globals/Object/defineProperty.mdx). -- [`handler.deleteProperty()`](../../globals/Proxy/proxy/deleteProperty.mdx) - - : A trap for the `delete` operator. -- [`handler.get()`](../../globals/Proxy/proxy/get.mdx) - - : A trap for getting property values. -- [`handler.getOwnPropertyDescriptor()`)}](../../globals/Proxy/proxy/getOwnPropertyDescriptor.mdx) - - : A trap for [`Object.getOwnPropertyDescriptor`](../../globals/Object/getOwnPropertyDescriptor.mdx). -- [`handler.getPrototypeOf()`](../../globals/Proxy/proxy/getPrototypeOf.mdx) - - : A trap for [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). -- [`handler.has()`](../../globals/Proxy/proxy/has.mdx) - - : A trap for the `in` operator. -- [`handler.isExtensible()`](../../globals/Proxy/proxy/isExtensible.mdx) - - : A trap for [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx). -- [`handler.ownKeys()`](../../globals/Proxy/proxy/ownKeys.mdx) - - : A trap for [`Object.getOwnPropertyNames()`](../../globals/Object/getOwnPropertyNames.mdx) and - [`Object.getOwnPropertySymbols()`](../../globals/Object/getOwnPropertySymbols.mdx). -- [`handler.preventExtensions()`)}](../../globals/Proxy/proxy/preventExtensions.mdx) - - : A trap for [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx). -- [`handler.set()`](../../globals/Proxy/proxy/set.mdx) - - : A trap for setting property values. -- [`handler.setPrototypeOf()`](../../globals/Proxy/proxy/setPrototypeOf.mdx) - - : A trap for [`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/apply.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/apply.mdx deleted file mode 100644 index a6f85b0596..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/apply.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.apply() - -The **`handler.apply()`** method is a trap for a function call. - -## Syntax - -```js -new Proxy(target, { - apply(target, thisArg, argumentsList) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `apply()` method. `this` is bound to the handler. - -- `target` - - : The target callable object. -- `thisArg` - - : The `this` argument for the call. -- `argumentsList` - - : The list of arguments for the call. - -### Return value - -The `apply()` method can return any value. - -## Description - -The **`handler.apply()`** method is a trap for a function call. - -### Interceptions - -This trap can intercept these operations: - -- Function call: `proxy(...args)` -- [`Function.prototype.apply()`](../../../globals/Function/prototype/apply.mdx) and [`Function.prototype.call()`](../../../globals/Function/prototype/call.mdx) -- [`Reflect.apply()`](../../../globals/Reflect/apply.mdx) - -Or any other operation that invokes the `[[Call]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The `target` must be a callable itself. That is, it must be a function object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/construct.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/construct.mdx deleted file mode 100644 index 84ee38bd19..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/construct.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.construct() - -The **`handler.construct()`** method is a trap for the `new` operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a `[[Construct]]` internal method (i.e. `new target` must be valid). - -## Syntax - -```js -new Proxy(target, { - construct(target, argumentsList, newTarget) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `construct()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `argumentsList` - - : The list of arguments for the constructor. -- `newTarget` - - : The constructor that was originally called, `p` above. - -### Return value - -The `construct` method must return an object. - -## Description - -The **`handler.construct()`** method is a trap for the `new` operator. - -### Interceptions - -This trap can intercept these operations: - -- The `new` operator: `new myFunction(...args)` -- [`Reflect.construct()`](../../../globals/Reflect/construct.mdx) - -Or any other operation that invokes the `[[Construct]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result must be an `Object`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/defineProperty.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/defineProperty.mdx deleted file mode 100644 index 0270c7b7d0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/defineProperty.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.defineProperty() - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -## Syntax - -```js -new Proxy(target, { - defineProperty(target, property, descriptor) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `defineProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property whose description is to be - retrieved. -- `descriptor` - - : The descriptor for the property being defined or modified. - -### Return value - -The `defineProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully defined. - -## Description - -The **`handler.defineProperty()`** method is a trap for -[`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.defineProperty()`](../../../globals/Object/defineProperty.mdx), [`Object.defineProperties()`](../../../globals/Object/defineProperties.mdx) -- [`Reflect.defineProperty()`](../../../globals/Reflect/defineProperty.mdx) - -Or any other operation that invokes the `[[DefineOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be added, if the target object is not extensible. -- A property cannot be added as or modified to be non-configurable, if it does not - exists as a non-configurable own property of the target object. -- A property may not be non-configurable, if a corresponding configurable property of - the target object exists. -- If a property has a corresponding target object property then - `Object.defineProperty(target, prop, descriptor)` - will not throw an exception. -- In strict mode, a `false` return value from the - `defineProperty()` handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/deleteProperty.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/deleteProperty.mdx deleted file mode 100644 index e4bb72356e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/deleteProperty.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.deleteProperty() - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -## Syntax - -```js -new Proxy(target, { - deleteProperty(target, property) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `deleteProperty()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to delete. - -### Return value - -The `deleteProperty()` method must return a `Boolean` indicating -whether or not the property has been successfully deleted. - -## Description - -The **`handler.deleteProperty()`** method is a trap for the `delete` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`delete`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) operator: `delete proxy[foo]` and - `delete proxy.foo` -- [`Reflect.deleteProperty()`](../../../globals/Reflect/deleteProperty.mdx) - -Or any other operation that invokes the `[[Delete]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be deleted, if it exists as a non-configurable own property of the - target object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/get.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/get.mdx deleted file mode 100644 index 0db620ab4a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/get.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.get() - -The **`handler.get()`** method is a trap for getting a property -value. - -## Syntax - -```js -new Proxy(target, { - get(target, property, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `get()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to get. -- `receiver` - - : Either the proxy or an object that inherits from the proxy. - -### Return value - -The `get()` method can return any value. - -## Description - -The **`handler.get()`** method is a trap for getting a property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property access: `proxy[foo]` and `proxy.bar` -- [`Reflect.get()`](../../../globals/Reflect/get.mdx) - -Or any other operation that invokes the `[[Get]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The value reported for a property must be the same as the value of the corresponding - target object property if the target object property is a non-writable, - non-configurable own data property. -- The value reported for a property must be undefined if the corresponding target - object property is a non-configurable own accessor property that has - `undefined` as its `[[Get]]` attribute. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx deleted file mode 100644 index 4700fc8e9e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getOwnPropertyDescriptor() - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - - - -## Syntax - -```js -new Proxy(target, { - getOwnPropertyDescriptor(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `getOwnPropertyDescriptor()` method. `this` is bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name of the property whose description should be retrieved. - -### Return value - -The `getOwnPropertyDescriptor()` method must return an object or `undefined`. - -## Description - -The **`handler.getOwnPropertyDescriptor()`** method is a trap for [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyDescriptor()`](../../../globals/Object/getOwnPropertyDescriptor.mdx) -- [`Reflect.getOwnPropertyDescriptor()`](../../../globals/Reflect/getOwnPropertyDescriptor.mdx) - -Or any other operation that invokes the `[[GetOwnProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getOwnPropertyDescriptor()` must return an object or `undefined`. -- A property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as existent, if it does not exists as an own property of the target object and the target object is not extensible. -- A property cannot be reported as non-configurable, if it does not exists as an own property of the target object or if it exists as a configurable own property of the target object. -- The result of `Object.getOwnPropertyDescriptor(target)` can be applied to the target object using `Object.defineProperty()` and will not throw an exception. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/getPrototypeOf.mdx deleted file mode 100644 index 2a212d1975..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/getPrototypeOf.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.getPrototypeOf() - -The **`handler.getPrototypeOf()`** method is a trap for the -`[[GetPrototypeOf]]` internal method. - -## Syntax - -```js -new Proxy(obj, { - getPrototypeOf(target) { - // … - } -}); -``` - -### Parameters - -The following parameter is passed to the `getPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `getPrototypeOf()` method must return an object or `null`. - -## Description - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getPrototypeOf()`](../../../globals/Object/getPrototypeOf.mdx) -- [`Reflect.getPrototypeOf()`](../../../globals/Reflect/getPrototypeOf.mdx) -- [`Object.prototype.isPrototypeOf()`](../../../globals/Object/prototype/isPrototypeOf.mdx) -- `instanceof` - -Or any other operation that invokes the `[[GetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `getPrototypeOf()` method must return an object or `null`. -- If `target` is not extensible, - `Object.getPrototypeOf(proxy)` method must return the same - value as `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/has.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/has.mdx deleted file mode 100644 index 219cb2fcd2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/has.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.has() - -The **`handler.has()`** method is a trap for the `in` operator. - -## Syntax - -```js -new Proxy(target, { - has(target, prop) { - } -}); -``` - -### Parameters - -The following parameters are passed to `has()` method. `this` is -bound to the handler. - -- `target` - - : The target object. -- `prop` - - : The name or `Symbol` of the property to check for existence. - -### Return value - -The `has()` method must return a boolean value. - -## Description - -The **`handler.has()`** method is a trap for the `in` operator. - -### Interceptions - -This trap can intercept these operations: - -- The [`in`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) operator: `foo in proxy` -- [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) check: `with(proxy) { (foo); }` -- [`Reflect.has()`](../../../globals/Reflect/has.mdx) - -Or any other operation that invokes the `[[HasProperty]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- A property cannot be reported as non-existent, if it exists as a non-configurable - own property of the target object. -- A property cannot be reported as non-existent, if it exists as an own property of - the target object and the target object is not extensible. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/isExtensible.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/isExtensible.mdx deleted file mode 100644 index 0b71af636d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/isExtensible.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.isExtensible() - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -## Syntax - -```js -new Proxy(target, { - isExtensible(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `isExtensible()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `isExtensible()` method must return a boolean value. - -## Description - -The **`handler.isExtensible()`** method is a trap for -[`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.isExtensible()`](../../../globals/Object/isExtensible.mdx) -- [`Reflect.isExtensible()`](../../../globals/Reflect/isExtensible.mdx) - -Or any other operation that invokes the `[[IsExtensible]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.isExtensible(proxy)` must return the same value as - `Object.isExtensible(target)`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/ownKeys.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/ownKeys.mdx deleted file mode 100644 index d2e86b0c65..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/ownKeys.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.ownKeys() - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -## Syntax - -```js -new Proxy(target, { - ownKeys(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `ownKeys()` method. -`this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `ownKeys()` method must return an enumerable object. - -## Description - -The **`handler.ownKeys()`** method is a trap for -[`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.getOwnPropertyNames()`](../../../globals/Object/getOwnPropertyNames.mdx) -- [`Object.getOwnPropertySymbols()`](../../../globals/Object/getOwnPropertySymbols.mdx) -- [`Object.keys()`](../../../globals/Object/keys.mdx) -- [`Reflect.ownKeys()`](../../../globals/Reflect/ownKeys.mdx) - -Or any other operation that invokes the `[[OwnPropertyKeys]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- The result of `ownKeys()` must be an array. -- The type of each array element is either a `String` or a `Symbol`. -- The result List must contain the keys of all non-configurable own properties of the - target object. -- If the target object is not extensible, then the result List must contain all the - keys of the own properties of the target object and no other values. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/preventExtensions.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/preventExtensions.mdx deleted file mode 100644 index 6f32c9bbea..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/preventExtensions.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.preventExtensions() - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -## Syntax - -```js -new Proxy(target, { - preventExtensions(target) { - } -}); -``` - -### Parameters - -The following parameter is passed to the `preventExtensions()` method. `this` is bound to the handler. - -- `target` - - : The target object. - -### Return value - -The `preventExtensions()` method must return a boolean value. - -## Description - -The **`handler.preventExtensions()`** method is a trap for [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.preventExtensions()`](../../../globals/Object/preventExtensions.mdx) -- [`Reflect.preventExtensions()`](../../../globals/Reflect/preventExtensions.mdx) -- [`Object.seal()`](../../../globals/Object/seal.mdx) -- [`Object.freeze()`](../../../globals/Object/freeze.mdx) - -Or any other operation that invokes the `[[PreventExtensions]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- `Object.preventExtensions(proxy)` only returns `true` if `Object.isExtensible(proxy)` is `false`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/set.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/set.mdx deleted file mode 100644 index af24934b75..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/set.mdx +++ /dev/null @@ -1,77 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.set() - -The **`handler.set()`** method is a trap for setting a property -value. - -## Syntax - -```js -new Proxy(target, { - set(target, property, value, receiver) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `set()` method. `this` -is bound to the handler. - -- `target` - - : The target object. -- `property` - - : The name or `Symbol` of the property to set. -- `value` - - : The new value of the property to set. -- `receiver` - - - : The object to which the assignment was originally directed. This is usually the - proxy itself. But a `set()` handler can also be called indirectly, via - the prototype chain or various other ways. - - For example, suppose a script does - `obj.name = "jen"`, and `obj` is not a - proxy, and has no own property `.name`, but it has a proxy on its - prototype chain. That proxy's `set()` handler will be called, and - `obj` will be passed as the receiver. - -### Return value - -The `set()` method should return a boolean value. - -- Return `true` to indicate that assignment succeeded. -- If the `set()` method returns `false`, and the assignment - happened in strict-mode code, a [`TypeError`](../../../globals/TypeError/TypeError.mdx) will be thrown. - -## Description - -The **`handler.set()`** method is a trap for setting property -value. - -### Interceptions - -This trap can intercept these operations: - -- Property assignment: `proxy[foo] = bar` and `proxy.foo = bar` -- [`Reflect.set()`](../../../globals/Reflect/set.mdx) - -Or any other operation that invokes the `[[Set]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- Cannot change the value of a property to be different from the value of the - corresponding target object property if the corresponding target object property is a - non-writable, non-configurable data property. -- Cannot set the value of a property if the corresponding target object property is a - non-configurable accessor property that has `undefined` as its - `[[Set]]` attribute. -- In strict mode, a `false` return value from the `set()` - handler will throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) exception. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/setPrototypeOf.mdx deleted file mode 100644 index 4b781b550c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/proxy/setPrototypeOf.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# handler.setPrototypeOf() - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -## Syntax - -```js -new Proxy(target, { - setPrototypeOf(target, prototype) { - } -}); -``` - -### Parameters - -The following parameters are passed to the `setPrototypeOf()` method. -`this` is bound to the handler. - -- `target` - - : The target object. -- `prototype` - - : The object's new prototype or `null`. - -### Return value - -The `setPrototypeOf()` method returns `true` if the -`[[Prototype]]` was successfully changed, otherwise `false`. - -## Description - -The **`handler.setPrototypeOf()`** method is a trap for -[`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx). - -### Interceptions - -This trap can intercept these operations: - -- [`Object.setPrototypeOf()`](../../../globals/Object/setPrototypeOf.mdx) -- [`Reflect.setPrototypeOf()`](../../../globals/Reflect/setPrototypeOf.mdx) - -Or any other operation that invokes the `[[SetPrototypeOf]]` [internal method](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy#object_internal_methods). - -### Invariants - -If the following invariants are violated, the trap throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when invoked. - -- If `target` is not extensible, the `prototype` - parameter must be the same value as - `Object.getPrototypeOf(target)`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Proxy/revocable.mdx b/documentation/versioned_docs/version-3.9.0/globals/Proxy/revocable.mdx deleted file mode 100644 index 4ee41655f6..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Proxy/revocable.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Proxy.revocable() - -The **`Proxy.revocable()`** static method creates a revocable `Proxy` object. - -## Syntax - -```js -Proxy.revocable(target, handler) -``` - -### Parameters - -- `target` - - : A target object to wrap with `Proxy`. It can be any sort of object, including a native array, a function, or even another proxy. -- `handler` - - : An object whose properties are functions defining the behavior of `proxy` when an operation is performed on it. - -### Return value - -A plain object with the following two properties: - -- `proxy` - - : A Proxy object exactly the same as one created with a [`new Proxy(target, handler)`](../../globals/Proxy/Proxy.mdx) call. -- `revoke` - - : A function with no parameters to revoke (switch off) the `proxy`. - -## Description - -The `Proxy.revocable()` factory function is the same as the [`Proxy()`](../../globals/Proxy/Proxy.mdx) constructor, except that in addition to creating a proxy object, it also creates a `revoke` function that can be called to disable the proxy. The proxy object and the `revoke` function are wrapped in a plain object. - -The `revoke` function does not take any parameters, nor does it rely on the `this` value. The created `proxy` object is attached to the `revoke` function as a [private property](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/Private_class_fields) that the `revoke` function accesses on itself when called (the existence of the private property is not observable from the outside, but it has implications on how garbage collection happens). The `proxy` object is _not_ captured within the [closure](https://developer.mozilla.org/docs/Web/JavaScript/Closures) of the `revoke` function (which will make garbage collection of `proxy` impossible if `revoke` is still alive). - -After the `revoke()` function gets called, the proxy becomes unusable: any trap to a handler throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). Once a proxy is revoked, it remains revoked, and calling `revoke()` again has no effect — in fact, the call to `revoke()` detaches the `proxy` object from the `revoke` function, so the `revoke` function will not be able to access the proxy again at all. If the proxy is not referenced elsewhere, it will then be eligible for garbage collection. The `revoke` function also detaches `target` and `handler` from the `proxy`, so if `target` is not referenced elsewhere, it will also be eligible for garbage collection, even when its proxy is still alive, since there's no longer a way to meaningfully interact with the target object. - -Letting users interact with an object through a revocable proxy allows you to [control the lifetime](https://developer.mozilla.org/docs/Web/JavaScript/Memory_Management) of the object exposed to the user — you can make the object garbage-collectable even when the user is still holding a reference to its proxy. diff --git a/documentation/versioned_docs/version-3.9.0/globals/RangeError/RangeError.mdx b/documentation/versioned_docs/version-3.9.0/globals/RangeError/RangeError.mdx deleted file mode 100644 index 49d5046bf1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/RangeError/RangeError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RangeError - -The **`RangeError()`** constructor creates an error -when a value is not in the set or range of allowed values. - -## Syntax - -```js -new RangeError() -new RangeError(message) -new RangeError(message, options) -new RangeError(message, fileName) -new RangeError(message, fileName, lineNumber) - -RangeError() -RangeError(message) -RangeError(message, options) -RangeError(message, fileName) -RangeError(message, fileName, lineNumber) -``` - -> **Note:** `RangeError()` can be called with or without `new`. Both create a new `RangeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx deleted file mode 100644 index e695c16dc1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/byobRequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# byobRequest - -The **`byobRequest`** read-only property of the `ReadableByteStreamController` interface returns the current BYOB request, or `null` if there are no pending requests. - -An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using `ReadableByteStreamController.enqueue()`). -This will result in an efficient zero-byte transfer of the data to the consumer. - -## Value - -A `ReadableStreamBYOBRequest` object instance, or `null`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/close.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/close.mdx deleted file mode 100644 index fc54cf3a27..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/close.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# close() - -The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream. - -This might be called by the underlying source when its data source has been exhausted/completed. - -> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. -> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx deleted file mode 100644 index e66d9afa7a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/desiredSize.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# desiredSize - -The **`desiredSize`** read-only property of the`ReadableByteStreamController` interface returns the number of bytes required to fill the stream's internal queue to its "desired size". - -The value is used by the stream to indicate a preferred flow rate to the underlying source. -Sources that support throttling or pausing their inflow of data (not all do!) should control the inflow such that `desiredSize` of the stream buffer is kept positive and as close to zero as possible. - -The `desiredSize` is used to apply backpressure from downstream consumers. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream has errored and `0` if it is closed. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/enqueue.mdx deleted file mode 100644 index db954d65e6..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/enqueue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# enqueue() - -The **`enqueue()`** method of the `ReadableByteStreamController` interface enqueues a given chunk on the associated readable byte stream (the chunk is copied into the stream's internal queues). - -This should only be used to transfer data to the queue when `byobRequest` is `null`. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existent, zero-length, or detached. - It is also thrown if the stream has been closed. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/error.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/error.mdx deleted file mode 100644 index 5e7c37136a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableByteStreamController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# error() - -The **`error()`** method of the `ReadableByteStreamController` interface causes any future interactions with the associated stream to error with the specified reason. - -This is commonly called by an underlying source to surface an error from the interface where it gets its data (such as a file-read or socket error). -It can also be called from elsewhere to trigger a stream error, for example if another part of the system that the stream relies on fails. - -## Syntax - -```js -error(errorObject) -``` - -### Parameters - -- `errorObject` - - : Any object that you want future interactions to fail with. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableByteStreamController`, or the stream is not readable for some other reason. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/ReadableStream.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/ReadableStream.mdx deleted file mode 100644 index 4412b0c79e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/ReadableStream.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream() - -The **`ReadableStream()`** constructor creates and returns a readable stream object from the given handlers. - -## Syntax - -```js -new ReadableStream() -new ReadableStream(underlyingSource) -new ReadableStream(underlyingSource, queuingStrategy) -``` - -### Parameters - -- `underlyingSource` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream instance will behave. - `underlyingSource` can contain the following: - - - `start` (controller) _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the stream source, and do anything else required to set up the stream - functionality. If this process is to be done asynchronously, it can return a - promise to signal success or failure. The `controller` parameter passed - to this method is a `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream during set up. - - `pull` (controller) _**optional**_ - - : This method, also defined by the developer, will be called repeatedly when the - stream's internal queue of chunks is not full, up until it reaches its high water - mark. If `pull()` returns a promise, then it won't be called again - until that promise fulfills; if the promise rejects, the stream will become - errored. The `controller` parameter passed to this method is a - `ReadableStreamDefaultController` or a - `ReadableByteStreamController`, depending on the value of the - `type` property. This can be used by the developer to control the - stream as more chunks are fetched. - - `cancel` (reason) _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that the stream is to be cancelled (e.g. if `ReadableStream.cancel()` - is called). The contents should do whatever is necessary to release access to the - stream source. If this process is asynchronous, it can return a promise to signal - success or failure. The `reason` parameter contains a - string describing why the stream was cancelled. - - `type` _**optional**_ - - : This property controls what type of readable stream is being dealt with. If it - is included with a value set to `"bytes"`, the passed controller object - will be a `ReadableByteStreamController` capable of handling a BYOB - (bring your own buffer)/byte stream. If it is not included, the passed controller - will be a `ReadableStreamDefaultController`. - - `autoAllocateChunkSize` _**optional**_ - - - : For byte streams, the developer can set the `autoAllocateChunkSize` with a positive integer value to turn on the stream's auto-allocation feature. - With this is set, the stream implementation will automatically allocate a view buffer of the specified size in `ReadableByteStreamController.byobRequest` when required. - - This must be set to enable zero-copy transfers to be used with a default `ReadableStreamDefaultReader`. - If not set, a default reader will still stream data, but `ReadableByteStreamController.byobRequest` will always be `null` and transfers to the consumer must be via the stream's internal queues. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to - use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of - > 1\. - -### Return value - -An instance of the `ReadableStream` object. - -### Exceptions - -- `RangeError` - - Thrown if the supplied type value is neither `"bytes"` nor `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/cancel.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/cancel.mdx deleted file mode 100644 index 3846264a68..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/cancel.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.cancel() - -The **`cancel()`** method of the -`ReadableStream` interface returns a `Promise` that -resolves when the stream is canceled. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to cancel is not a `ReadableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/getReader.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/getReader.mdx deleted file mode 100644 index 756de632d5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/getReader.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.getReader() - -The **`getReader()`** method of the `ReadableStream` interface creates a reader and locks the stream to it. -While the stream is locked, no other reader can be acquired until this one is released. - -## Syntax - -```js -getReader() -getReader(options) -``` - -### Parameters - -- `options` _**optional**_ - - - : An object containing the following properties: - - - `mode` _**optional**_ - - - : A property that specifies the type of reader to create. - Values can be: - - - `"byob"`, which results in a `ReadableStreamBYOBReader` being created that can read readable byte streams (streams that support zero-copy transfer from an underlying byte source to the reader when internal stream buffers are empty). - - `undefined` (or not specified at all — this is the default), which results in a `ReadableStreamDefaultReader` being created that can read individual chunks from a stream. - -### Return value - -A `ReadableStreamDefaultReader` or `ReadableStreamBYOBReader` object instance, depending on the `mode` value. - -### Exceptions - -- `RangeError` - - : Thrown if the provided mode value is not `"byob"` or `undefined`. -- `TypeError` - - : Thrown if the stream you are trying to create a reader for is already locked, or not a `ReadableStream`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/locked.mdx deleted file mode 100644 index 602f954cad..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/locked.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.locked - -The **`locked`** read-only property of the `ReadableStream` interface returns whether or not the readable stream is locked to a reader. - -A readable stream can have at most one active reader at a time, and is locked to that reader until it is released. -A reader might be obtained using `ReadableStream.getReader()` and released using the reader's `releaseLock()` method. - -## Value - -A `boolean` value indicating whether or not the readable stream is locked. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/pipeThrough.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/pipeThrough.mdx deleted file mode 100644 index 4b0df71837..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/pipeThrough.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeThrough() - -The **`pipeThrough()`** method of the `ReadableStream` interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. - -Piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeThrough(transformStream) -pipeThrough(transformStream, options) -``` - -### Parameters - -- `transformStream` - - - : A `TransformStream` (or an object with the structure - `{writable, readable}`) consisting of a readable stream and a writable - stream working together to transform some data from one form to another. Data written - to the `writable` stream can be read in some transformed state by the - `readable` stream. For example, a `TextDecoder`, has bytes - written to it and strings read from it, while a video decoder has encoded bytes - written to it and uncompressed video frames read from it. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. - - - `preventAbort` - - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - - `preventCancel` - - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -The `readable` side of the `transformStream`. - -### Exceptions - -- `TypeError` - - : Thrown if the `writable` and/or `readable` property of `transformStream` are undefined. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/pipeTo.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/pipeTo.mdx deleted file mode 100644 index 4bc6e8cb03..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/pipeTo.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.pipeTo() - -The **`pipeTo()`** method of the `ReadableStream` interface pipes the current `ReadableStream` to a given `WritableStream` and returns a `Promise` that fulfills when the piping process completes successfully, or rejects if any errors were encountered. - -Piping a stream will generally `lock` it for the duration of the pipe, preventing other readers from locking it. - -## Syntax - -```js -pipeTo(destination) -pipeTo(destination, options) -``` - -### Parameters - -- `destination` - - - : A `WritableStream` that acts as the final destination for the `ReadableStream`. - -- `options` _**optional**_ - - - : The options that should be used when piping to the `writable` stream. - Available options are: - - - `preventClose` - - : If this is set to `true`, the source `ReadableStream` closing will no longer cause the destination `WritableStream` to be closed. - The method will return a fulfilled promise once this process completes, unless an error is encountered while closing the destination in which case it will be rejected with that error. - - `preventAbort` - - : If this is set to `true`, errors in the source `ReadableStream` will no longer abort the destination `WritableStream`. - The method will return a promise rejected with the source's error, or with any error that occurs during aborting the destination. - - `preventCancel` - - : If this is set to `true`, errors in the destination `WritableStream` will no longer cancel the source `ReadableStream`. - In this case the method will return a promise rejected with the source's error, or with any error that occurs during canceling the source. - In addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled. - In this case the method will return a promise rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. - -### Return value - -A `Promise` that resolves when the piping process has completed. - -### Exceptions - -- `TypeError` - - : The `writableStream` and/or `readableStream` objects are not a writable stream/readable stream, or one or both of the streams are locked. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/tee.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/tee.mdx deleted file mode 100644 index e497ac913d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStream/prototype/tee.mdx +++ /dev/null @@ -1,57 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStream.tee() - -The **`tee()`** method of the -`ReadableStream` interface [tees](https://streams.spec.whatwg.org/#tee-a-readable-stream) the current readable stream, returning a -two-element array containing the two resulting branches as -new `ReadableStream` instances. - -This is useful for allowing two readers to read a stream sequentially or simultaneously, -perhaps at different speeds. -For example, you might do this in a ServiceWorker if you want to fetch -a response from the server and stream it to the browser, but also stream it to the -ServiceWorker cache. Since a response body cannot be consumed more than once, you'd need -two copies to do this. - -A teed stream will partially signal backpressure at the rate of the _faster_ consumer -of the two `ReadableStream` branches, -and unread data is enqueued internally on the slower consumed `ReadableStream` -without any limit or backpressure. -That is, when _both_ branches have an unread element in their internal queue, -then the original `ReadableStream`'s controller's internal queue will start to fill up, -and once its `ReadableStreamDefaultController.desiredSize", "desiredSize` ≤ 0 -or byte stream controller `ReadableByteStreamController.desiredSize", "desiredSize` ≤ 0, -then the controller will stop calling `pull(controller)` on the -underlying source passed to `ReadableStream.ReadableStream", "new ReadableStream()`. -If only one branch is consumed, then the entire body will be enqueued in memory. -Therefore, you should not use the built-in `tee()` to read very large streams -in parallel at different speeds. -Instead, search for an implementation that fully backpressures -to the speed of the _slower_ consumed branch. - -To cancel the stream you then need to cancel both resulting branches. Teeing a stream -will generally lock it for the duration, preventing other readers from locking it. - -## Syntax - -```js -tee() -``` - -### Parameters - -None. - -### Return value - -An `Array` containing two `ReadableStream` instances. - -### Exceptions - -- `TypeError` - - : Thrown if the source stream is not a `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx deleted file mode 100644 index 82d6187b34..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/ReadableStreamBYOBReader.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# ReadableStreamBYOBReader() - -The **`ReadableStreamBYOBReader()`** constructor creates and returns a `ReadableStreamBYOBReader` object instance. - -> **Note:** You generally wouldn't use this constructor manually; -> instead, you'd use the `ReadableStream.getReader()` method with the argument `"byob"`. - -## Syntax - -```js -new ReadableStreamBYOBReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamBYOBReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, or it is already locked for reading by another reader, or its stream controller is not a `ReadableByteStreamController`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx deleted file mode 100644 index 5b216f4f6f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/cancel.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# cancel() - -The **`cancel()`** method of the `ReadableStreamBYOBReader` interface returns a `Promise` that resolves when the stream is canceled. -Calling this method signals a loss of interest in the stream by a consumer. - -> **Note:** If the reader is active, the `cancel()` method behaves the same as that for the associated stream (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` __optional__ - - : A human-readable reason for the cancellation. The underlying source may or may not use it. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, or the stream has no owner. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx deleted file mode 100644 index c8bb1fe149..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# closed - -The **`closed`** read-only property of the `ReadableStreamBYOBReader` interface returns a `Promise` that fulfills when the stream closes, or rejects if the stream throws an error or the reader's lock is released. - -This property enables you to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/read.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/read.mdx deleted file mode 100644 index 4a40512f46..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/read.mdx +++ /dev/null @@ -1,73 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# read() - -The **`read()`** method of the `ReadableStreamBYOBReader` interface is used to read data into a view on a user-supplied buffer from an associated readable byte stream. -A request for data will be satisfied from the stream's internal queues if there is any data present. -If the stream queues are empty, the request may be supplied as a zero-copy transfer from the underlying byte source. - -The method takes as an argument a view on a buffer that supplied data is to be read into, and returns a `Promise`. -The promise fulfills with an object that has properties `value` and `done` when data comes available, or if the stream is cancelled. -If the stream is errored, the promise will be rejected with the relevant error object. - -If a chunk of data is supplied, the `value` property will contain a new view. -This will be a view over the same buffer/backing memory (and of the same type) as the original `view` passed to the `read()` method, now populated with the new chunk of data. -Note that once the promise fulfills, the original `view` passed to the method will be detached and no longer usable. -The promise will fulfill with a `value: undefined` if the stream has been cancelled. -In this case the backing memory region of `view` is discarded and not returned to the caller (all previously read data in the view's buffer is lost). - -The `done` property indicates whether or not more data is expected. -The value is set `true` if the stream is closed or cancelled, and `false` otherwise. - -## Syntax - -```js -read(view) -``` - -### Parameters - -- `view` - - : The view that data is to be read into. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. - -The following are possible: - -- If a chunk is available and the stream is still active, the promise fulfills with an object of the form: - - ``` - { value: theChunk, done: false } - ``` - - `theChunk` is a view containing the new data. - This is a view of the same type and over the same backing memory as the `view` passed to the `read()` method. - The original `view` will be detached and no longer usable. - -- If the stream is closed, the promise fulfills with an object of the form (where `theChunk` has the same properties as above): - - ``` - { value: theChunk, done: true } - ``` - -- If the stream is cancelled, the promise fulfills with an object of the form: - - ``` - { value: undefined, done: true } - ``` - - In this case the backing memory is discarded. - -- If the stream throws an error, the promise rejects with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamBYOBReader`, the stream has no owner, the view is not an object or has become detached, the view's length is 0, or `ReadableStreamBYOBReader.releaseLock()` is called (when there's is a pending read request). diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx deleted file mode 100644 index b535963629..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamBYOBReader` interface releases the reader's lock on the stream. -After the lock is released, the reader is no longer active. - -The reader will appear errored if the associated stream is errored when the lock is released; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamBYOBReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamBYOBReader`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx deleted file mode 100644 index a0ae652259..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBRequest/prototype/respond.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respond() - -The **`respond()`** method of the `ReadableStreamBYOBRequest` interface is used to signal to the associated readable byte stream that the specified number of bytes were written into the `ReadableStreamBYOBRequest.view`. - -After this method is called, the `view` will be transferred and no longer modifiable. - -## Syntax - -```js -respond(bytesWritten) -``` - -### Parameters - -- `bytesWritten` - - : The number of bytes written into `ReadableStreamBYOBRequest.view`. - -### Return value - -`undefined`. - -### Exceptions - -- `TypeError` - - : The request does not have an associated `ReadableByteStreamController` or the view buffer is not detached/cannot be transferred into. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx deleted file mode 100644 index d5b3c92888..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBRequest/prototype/respondWithNewView.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# respondWithNewView() - -The **`respondWithNewView()`** method of the `ReadableStreamBYOBRequest` interface specifies a new view that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - -The new view must be a `TypedArray` or a `DataView` that provides a view onto the same backing memory region as `ReadableStreamBYOBRequest.view`. -After this method is called, the view that was passed into the method will be transferred and no longer modifiable. - -The method is intended for use cases where an underlying byte source needs to transfer a `byobRequest.view` internally before finishing its response. -For example, the source may transfer the BYOB view to a separate worker thread, and wait for the worker to transfer it back once it has been filled. - -## Syntax - -```js -respondWithNewView(view) -``` - -### Parameters - -- `view` - - - : A `TypedArray` or a `DataView` that the consumer of the associated readable byte stream should write to instead of `ReadableStreamBYOBRequest.view`. - - This must be a view onto the same backing memory region as `ReadableStreamBYOBRequest.view` and occupy the same or less memory. - Specifically, it must be either the view's buffer or a transferred version, must have the same `byteOffset`, and a `byteLength` (number of bytes written) that is less than or equal to that of the view. - -### Return value - -`undefined` - -### Exceptions - -- `TypeError` - - - : Thrown if the source object is not a `ReadableStreamBYOBRequest`, or there is no associated controller, or the associated internal array buffer is non-existent or detached. - It may also be thrown if the `view` is zero-length when there is an active reader, or non-zero when called on a closed stream. - -- `RangeError` - - : Thrown if the new `view` does not match the backing memory region of `ReadableStreamBYOBRequest.view`. - For example, it is not the same buffer (or a transferred version), has a different `byteOffset`, or is larger than the memory available to the backing view. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx deleted file mode 100644 index cb0df57222..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamBYOBRequest/prototype/view.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# view - -The **`view`** getter property of the `ReadableStreamBYOBRequest` interface returns the current view. - -## Value - -A typed array representing the destination region to which the controller can write generated data. - -`null` if the request has already been responded to, by calling `ReadableStreamBYOBRequest.respond()` or `ReadableStreamBYOBRequest.respondWithNewView()`. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/close.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/close.mdx deleted file mode 100644 index 82724b6e22..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/close.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.close() - -The **`close()`** method of the -`ReadableStreamDefaultController` interface closes the associated stream. - -Readers will still be able to read any previously-enqueued chunks from the stream, -but once those are read, the stream will become closed. If you want to completely get -rid of the stream and discard any enqueued chunks, you'd use -`ReadableStream.cancel()` or -`ReadableStreamDefaultReader.cancel()`. - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 5430e7055f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the -`ReadableStreamDefaultController` interface returns the desired size -required to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index 5e68138210..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.enqueue() - -The **`enqueue()`** method of the -`ReadableStreamDefaultController` interface enqueues a given chunk in the -associated stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk to enqueue. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/error.mdx deleted file mode 100644 index 8e37f2fe86..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultController.error() - -The **`error()`** method of the -`ReadableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -> **Note:** The `error()` method can be called -> more than once, and can be called when the stream is not readable. - -## Syntax - -```js -error(e) -``` - -### Parameters - -- `e` - - : The error you want future interactions to fail with. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultController`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx deleted file mode 100644 index 0f9aaa91d2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/ReadableStreamDefaultReader.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader() - -The **`ReadableStreamDefaultReader()`** -constructor creates and returns a `ReadableStreamDefaultReader` object -instance. - -## Syntax - -```js -new ReadableStreamDefaultReader(stream) -``` - -### Parameters - -- `stream` - - : The `ReadableStream` to be read. - -### Return value - -An instance of the `ReadableStreamDefaultReader` object. - -### Exceptions - -- `TypeError` - - : Thrown if the supplied `stream` parameter is not a `ReadableStream`, - or it is already locked for reading by another reader. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx deleted file mode 100644 index 85ee40e6b8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/cancel.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -~ ReadableStreamDefaultReader.cancel() - -The **`cancel()`** method of the -`ReadableStreamDefaultReader` interface returns a `Promise` that resolves when the stream is canceled. Calling this method signals a loss of interest in the stream by a consumer. - -Cancel is used when you've completely finished with the stream and don't need any more -data from it, even if there are chunks enqueued waiting to be read. That data is lost -after cancel is called, and the stream is not readable any more. To read those chunks -still and not completely get rid of the stream, you'd use -`ReadableStreamDefaultController.close()`. - -> **Note:** If the reader is active, the -> `cancel()` method behaves the same as that for the associated stream -> (`ReadableStream.cancel()`). - -## Syntax - -```js -cancel() -cancel(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A human-readable reason for the cancellation. This value may or may not be used. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, or the stream - has no owner. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx deleted file mode 100644 index cf7427c9c4..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/closed.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.closed - -The **`closed`** read-only property of the -`ReadableStreamDefaultReader` interface returns a -`Promise` that fulfills when the stream closes, or rejects if the -stream throws an error or the reader's lock is released. This property enables you -to write code that responds to an end to the streaming process. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/read.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/read.mdx deleted file mode 100644 index ec2b2ecbc2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/read.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.read() - -The **`read()`** method of the `ReadableStreamDefaultReader` interface returns a `Promise` providing access to the next chunk in the stream's internal queue. - -## Syntax - -```js -read() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills/rejects with a result depending on the state of the stream. -The different possibilities are as follows: - -- If a chunk is available, the promise will be fulfilled with an object of the form `{ value: theChunk, done: false }`. -- If the stream becomes closed, the promise will be fulfilled with an object of the form `{ value: undefined, done: true }`. -- If the stream becomes errored, the promise will be rejected with the relevant error. - -### Exceptions - -- `TypeError` - - : The source object is not a `ReadableStreamDefaultReader`, the stream has no owner, or `ReadableStreamDefaultReader.releaseLock()` is called (when there's a pending read request). diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx deleted file mode 100644 index f5143c04ad..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReadableStreamDefaultReader/prototype/releaseLock.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReadableStreamDefaultReader.releaseLock() - -The **`releaseLock()`** method of the `ReadableStreamDefaultReader` interface releases the reader's lock on the stream. - -If the associated stream is errored when the lock is released, the reader will appear errored in that same way subsequently; otherwise, the reader will appear closed. - -If the reader's lock is released while it still has pending read requests then the promises returned by the reader's `ReadableStreamDefaultReader.read()` method are immediately rejected with a `TypeError`. -Unread chunks remain in the stream's internal queue and can be read later by acquiring a new reader. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). - -### Exceptions - -- `TypeError` - - : Thrown if the source object is not a `ReadableStreamDefaultReader`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/ReferenceError/ReferenceError.mdx b/documentation/versioned_docs/version-3.9.0/globals/ReferenceError/ReferenceError.mdx deleted file mode 100644 index 63a785612d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/ReferenceError/ReferenceError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# ReferenceError - -The **`ReferenceError`** object represents an error when a -non-existent variable is referenced. - -## Syntax - -```js -new ReferenceError() -new ReferenceError(message) -new ReferenceError(message, options) -new ReferenceError(message, fileName) -new ReferenceError(message, fileName, lineNumber) - -ReferenceError() -ReferenceError(message) -ReferenceError(message, options) -ReferenceError(message, fileName) -ReferenceError(message, fileName, lineNumber) -``` - -> **Note:** `ReferenceError()` can be called with or without `new`. Both create a new `ReferenceError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Reflect/apply.mdx b/documentation/versioned_docs/version-3.9.0/globals/Reflect/apply.mdx deleted file mode 100644 index 8257653152..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Reflect/apply.mdx +++ /dev/null @@ -1,48 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.apply() - -The static **`Reflect.apply()`** method calls a target function -with arguments as specified. - -## Syntax - -```js -Reflect.apply(target, thisArgument, argumentsList) -``` - -### Parameters - -- `target` - - : The target function to call. -- `thisArgument` - - : The value of `this` provided for the call to - `target`. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. - -### Return value - -The result of calling the given `target` function with the -specified `this` value and arguments. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if the `target` is not callable. - -## Description - -In ES5, you typically use the [`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx) method to call a -function with a given `this` value and `arguments` provided as an array -(or an [array-like object](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects)). - -```js -Function.prototype.apply.call(Math.floor, undefined, [1.75]); -``` - -With `Reflect.apply()` this becomes less verbose and easier to understand. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Reflect/construct.mdx b/documentation/versioned_docs/version-3.9.0/globals/Reflect/construct.mdx deleted file mode 100644 index 95201a7917..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Reflect/construct.mdx +++ /dev/null @@ -1,135 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.construct() - -The static **`Reflect.construct()`** method acts like the -`new` operator, but as a function. It is equivalent to -calling `new target(...args)`. It gives also the added option to specify a -different prototype. - -## Syntax - -```js -Reflect.construct(target, argumentsList) -Reflect.construct(target, argumentsList, newTarget) -``` - -### Parameters - -- `target` - - : The target function to call. -- `argumentsList` - - : An array-like object specifying the arguments with which - `target` should be called. -- `newTarget` _**optional**_ - - : The constructor whose prototype should be used. See also the [`new.target`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new.target) - operator. If `newTarget` is not present, its value defaults - to `target`. - -### Return value - -A new instance of `target` (or `newTarget`, -if present), initialized by `target` as a constructor with the -given `argumentsList`. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` or -`newTarget` are not constructors. - -## Description - -`Reflect.construct()` allows you to invoke a constructor with a variable -number of arguments. (This would also be possible by using the -[spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) combined with the -[`new` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/new).) - -```js -const obj = new Foo(...args); -const obj = Reflect.construct(Foo, args); -``` - -### Reflect.construct() vs Object.create() - -Prior to the introduction of `Reflect`, objects could be constructed using -an arbitrary combination of constructor and prototype by using -[`Object.create()`](../../globals/Object/create.mdx). - -```js -function OneClass() { - this.name = "one"; -} - -function OtherClass() { - this.name = "other"; -} - -// Calling this: -const obj1 = Reflect.construct(OneClass, args, OtherClass); - -// ...has the same result as this: -const obj2 = Object.create(OtherClass.prototype); -OneClass.apply(obj2, args); - -console.log(obj1.name); // 'one' -console.log(obj2.name); // 'one' - -console.log(obj1 instanceof OneClass); // false -console.log(obj2 instanceof OneClass); // false - -console.log(obj1 instanceof OtherClass); // true -console.log(obj2 instanceof OtherClass); // true - -// Another example to demonstrate below: - -function func1(a, b, c, d) { - console.log(arguments[3]); -} - -function func2(d, e, f, g) { - console.log(arguments[3]); -} - -const obj1 = Reflect.construct(func1, ["I", "Love", "my", "country"]); -``` - -However, while the end result is the same, there is one important difference in the -process. When using `Object.create()` and -[`Function.prototype.apply()`](../../globals/Function/prototype/apply.mdx), the `new.target` operator will -point to `undefined` within the function used as the constructor, since the -`new` keyword is not being used to create the object. - -When invoking `Reflect.construct()`, on the other hand, the -`new.target` operator will point to the `newTarget` -parameter if supplied, or `target` if not. - -```js -function OneClass() { - console.log("OneClass"); - console.log(new.target); -} -function OtherClass() { - console.log("OtherClass"); - console.log(new.target); -} - -const obj1 = Reflect.construct(OneClass, args); -// Logs: -// OneClass -// function OneClass { ... } - -const obj2 = Reflect.construct(OneClass, args, OtherClass); -// Logs: -// OneClass -// function OtherClass { ... } - -const obj3 = Object.create(OtherClass.prototype); -OneClass.apply(obj3, args); -// Logs: -// OneClass -// undefined -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/Reflect/defineProperty.mdx b/documentation/versioned_docs/version-3.9.0/globals/Reflect/defineProperty.mdx deleted file mode 100644 index 4bbfd61827..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Reflect/defineProperty.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.defineProperty() - -The static **`Reflect.defineProperty()`** method is like -[`Object.defineProperty()`](../../globals/Object/defineProperty.mdx) but returns a `Boolean`. - -## Syntax - -```js -Reflect.defineProperty(target, propertyKey, attributes) -``` - -### Parameters - -- `target` - - : The target object on which to define the property. -- `propertyKey` - - : The name of the property to be defined or modified. -- `attributes` - - : The attributes for the property being defined or modified. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -defined. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.defineProperty` method allows precise addition to or -modification of a property on an object. For more details, see the -[`Object.defineProperty`](../../globals/Object/defineProperty.mdx) which is similar. - -> **Note:** `Object.defineProperty` returns the -> object or throws a [`TypeError`](../../globals/TypeError/TypeError.mdx) if the property has not been successfully -> defined. `Reflect.defineProperty`, however, returns a `Boolean` -> indicating whether or not the property was successfully defined. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Reflect/deleteProperty.mdx b/documentation/versioned_docs/version-3.9.0/globals/Reflect/deleteProperty.mdx deleted file mode 100644 index 7ccdcf5bdd..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Reflect/deleteProperty.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.deleteProperty() - -The static -**`Reflect.deleteProperty()`** -method allows to delete properties. It is like the -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete) -as a function. - -## Syntax - -```js -Reflect.deleteProperty(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object on which to delete the property. -- `propertyKey` - - : The name of the property to be deleted. - -### Return value - -A `Boolean` indicating whether or not the property was successfully -deleted. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.deleteProperty` method allows you to delete a property on an -object. It returns a `Boolean` indicating whether or not the property was -successfully deleted. It is almost identical to the non-strict -[`delete` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/delete). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Reflect/get.mdx b/documentation/versioned_docs/version-3.9.0/globals/Reflect/get.mdx deleted file mode 100644 index 111e6fe07c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Reflect/get.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.get() - -The static **`Reflect.get()`** method works like getting a -property from an object (`target[propertyKey]`) as a function. - -## Syntax - -```js -Reflect.get(target, propertyKey) -Reflect.get(target, propertyKey, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to get the property. -- `propertyKey` - - : The name of the property to get. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to - `target` if a getter is encountered. When used with - `Proxy`, it can be an object that inherits from - `target`. - -### Return value - -The value of the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.get` method allows you to get a property on an object. It is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Reflect/getOwnPropertyDescriptor.mdx b/documentation/versioned_docs/version-3.9.0/globals/Reflect/getOwnPropertyDescriptor.mdx deleted file mode 100644 index f8c05601f9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Reflect/getOwnPropertyDescriptor.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getOwnPropertyDescriptor() - -The static -**`Reflect.getOwnPropertyDescriptor()`** method is similar to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx). It returns a property descriptor of -the given property if it exists on the object, `undefined` -otherwise. - - - -## Syntax - -```js -Reflect.getOwnPropertyDescriptor(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to get an own property descriptor for. - -### Return value - -A property descriptor object if the property exists in `target` -object; otherwise, [`undefined`](../../globals/undefined.mdx). - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getOwnPropertyDescriptor` method returns a property descriptor -of the given property if it exists in the `target` object, -[`undefined`](../../globals/undefined.mdx) otherwise. The only difference to -[`Object.getOwnPropertyDescriptor()`](../../globals/Object/getOwnPropertyDescriptor.mdx) is how non-object targets are handled. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Reflect/getPrototypeOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Reflect/getPrototypeOf.mdx deleted file mode 100644 index b6af043525..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Reflect/getPrototypeOf.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.getPrototypeOf() - -The static **`Reflect.getPrototypeOf()`** method is almost the -same method as [`Object.getPrototypeOf()`](../../globals/Object/getPrototypeOf.mdx). It returns the prototype (i.e. the -value of the internal `[[Prototype]]` property) of the specified object. - - - -## Syntax - -```js -Reflect.getPrototypeOf(target) -``` - -### Parameters - -- `target` - - : The target object of which to get the prototype. - -### Return value - -The prototype of the given object. If there are no inherited properties, -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) is returned. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.getPrototypeOf` method returns the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Reflect/has.mdx b/documentation/versioned_docs/version-3.9.0/globals/Reflect/has.mdx deleted file mode 100644 index 48f0167075..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Reflect/has.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.has() - -The static **`Reflect.has()`** method works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. - -## Syntax - -```js -Reflect.has(target, propertyKey) -``` - -### Parameters - -- `target` - - : The target object in which to look for the property. -- `propertyKey` - - : The name of the property to check. - -### Return value - -A `Boolean` indicating whether or not the `target` -has the property. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.has` method allows you to check if a property is in an object. -It works like the [`in` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/in) -as a function. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Reflect/isExtensible.mdx b/documentation/versioned_docs/version-3.9.0/globals/Reflect/isExtensible.mdx deleted file mode 100644 index 7e79869536..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Reflect/isExtensible.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.isExtensible() - -The static **`Reflect.isExtensible()`** method determines if an object is extensible (whether it can have new properties added to it). It is similar to [`Object.isExtensible()`](../../globals/Object/isExtensible.mdx), but with [some differences](#difference_with_object.isextensible). - -## Syntax - -```js -Reflect.isExtensible(target) -``` - -### Parameters - -- `target` - - : The target object which to check if it is extensible. - -### Return value - -A `Boolean` indicating whether or not the target is extensible. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Reflect/ownKeys.mdx b/documentation/versioned_docs/version-3.9.0/globals/Reflect/ownKeys.mdx deleted file mode 100644 index fe4c1bc2c5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Reflect/ownKeys.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.ownKeys() - -The static **`Reflect.ownKeys()`** method returns an array of -the `target` object's own property keys. - -## Syntax - -```js -Reflect.ownKeys(target) -``` - -### Parameters - -- `target` - - : The target object from which to get the own keys. - -### Return value - -An `Array` of the `target` object's own property -keys. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.ownKeys` method returns an array of the -`target` object's own property keys. Its return value is -equivalent to `Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Reflect/preventExtensions.mdx b/documentation/versioned_docs/version-3.9.0/globals/Reflect/preventExtensions.mdx deleted file mode 100644 index ad78e6233a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Reflect/preventExtensions.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.preventExtensions() - -The static **`Reflect.preventExtensions()`** method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to [`Object.preventExtensions()`](../../globals/Object/preventExtensions.mdx), but with [some differences](#difference_with_object.preventextensions). - -## Syntax - -```js -Reflect.preventExtensions(target) -``` - -### Parameters - -- `target` - - : The target object on which to prevent extensions. - -### Return value - -A `Boolean` indicating whether or not the target was successfully set to prevent extensions. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an `Object`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Reflect/set.mdx b/documentation/versioned_docs/version-3.9.0/globals/Reflect/set.mdx deleted file mode 100644 index 717160dcc0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Reflect/set.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.set() - -The static **`Reflect.set()`** method works like setting a -property on an object. - -## Syntax - -```js -Reflect.set(target, propertyKey, value) -Reflect.set(target, propertyKey, value, receiver) -``` - -### Parameters - -- `target` - - : The target object on which to set the property. -- `propertyKey` - - : The name of the property to set. -- `value` - - : The value to set. -- `receiver` _**optional**_ - - : The value of `this` provided for the call to the setter for `propertyKey` on `target`. If provided and `target` does not have a setter for `propertyKey`, the property will be set on `receiver` instead. - -### Return value - -A `Boolean` indicating whether or not setting the property was successful. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object`. - -## Description - -The `Reflect.set` method allows you to set a property on an object. It does -property assignment and is like the -[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Reflect/setPrototypeOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Reflect/setPrototypeOf.mdx deleted file mode 100644 index 7acea4e77a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Reflect/setPrototypeOf.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Reflect.setPrototypeOf() - -The static -**`Reflect.setPrototypeOf()`** method is the same method as -[`Object.setPrototypeOf()`](../../globals/Object/setPrototypeOf.mdx), except for its return type. It sets the -prototype (i.e., the internal `[[Prototype]]` property) of a specified -object to another object or to [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), and returns `true` if -the operation was successful, or `false` otherwise. - -## Syntax - -```js -Reflect.setPrototypeOf(target, prototype) -``` - -### Parameters - -- `target` - - : The target object of which to set the prototype. -- `prototype` - - : The object's new prototype (an object or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null)). - -### Return value - -A `Boolean` indicating whether or not the prototype was successfully set. - -### Exceptions - -A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an -`Object` or if `prototype` is neither an object nor -[`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null). - -## Description - -The `Reflect.setPrototypeOf` method changes the prototype (i.e. the value of -the internal `[[Prototype]]` property) of the specified object. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/Request/Request.mdx b/documentation/versioned_docs/version-3.9.0/globals/Request/Request.mdx deleted file mode 100644 index 3ace40c683..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Request/Request.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request() - -The **`Request()`** constructor creates a new -`Request` object. - -## Syntax - -```js -new Request(input) -new Request(input, options) -``` - -### Parameters - -- `input` - - - : Defines the resource that you wish to fetch. This can either be: - - - A string containing the direct URL of the resource you want to - fetch. - - A `Request` object, effectively creating a copy. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `headers` - - : Any headers you want to add to your request, contained - within a `Headers` object or an object literal with `String` values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `manualFramingHeaders`_: boolean_ _**optional**_ _**Fastly-specific**_ - - : The default value is `false`, which means that the framing headers are automatically created based on the message body. - In "automatic" mode, a `Content-Length` is used when the size of the body can be determined before it is sent. - Requests sent in streaming mode, where headers are sent immediately but the content of the body is streamed later, will receive a `Transfer-Encoding: chunked` to accommodate the dynamic generation of the body. - In "manual" mode, any `Content-Length` or `Transfer-Encoding` headers will be honored. - You must ensure that those headers have correct values permitted by the [HTTP/1.1 specification](https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.1). - If the provided headers are not permitted by the specification, the headers will revert to "automatic" mode and a diagnostic message will be logged about what was wrong. - If a `Content-Length` is permitted by the specification, but the value does not match the size of the actual body, the body will either be truncated (if it is too long), or the connection will be hung up early (if it is too short). - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/arrayBuffer.mdx deleted file mode 100644 index c5b8d728c1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.arrayBuffer() - -The **`arrayBuffer()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with an `ArrayBuffer`. - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an `ArrayBuffer`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/body.mdx b/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/body.mdx deleted file mode 100644 index e30dbb42cf..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/body.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.body - -The read-only **`body`** property of the `Request` -interface contains a `ReadableStream` with the body contents -that have been added to the request. Note that a request using the -`GET` or `HEAD` method cannot have a body -and `null` is returned in these cases. - -## Value - -A `ReadableStream` or `null`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/bodyUsed.mdx deleted file mode 100644 index 53edbc9830..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/bodyUsed.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.bodyUsed - -The read-only **`bodyUsed`** property of the -`Request` interface is a boolean value that indicates -whether the request body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/clone.mdx b/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/clone.mdx deleted file mode 100644 index e08220c446..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/clone.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.clone() - -The **`clone()`** method of the `Request` interface creates a copy of the current `Request` object. - -Like the underlying `ReadableStream.tee`` api, the `body` of a cloned `Response` -will signal backpressure at the rate of the _faster_ consumer of the two bodies, -and unread data is enqueued internally on the slower consumed `body` -without any limit or backpressure. -Beware when you construct a `Request` from a stream and then `clone` it. - -`clone()` throws a `TypeError` if the request body has already been used. In fact, the main reason `clone()` exists is to allow multiple uses of body objects (when they are one-use only.) - -If you intend to modify the request, you may prefer the `Request` constructor. - -## Syntax - -```js -clone() -``` - -### Parameters - -None. - -### Return value - -A `Request` object, which is an exact copy of the `Request` that `clone()` was called on. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/headers.mdx b/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/headers.mdx deleted file mode 100644 index be36fc98f0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.headers - -The **`headers`** read-only property of the -`Request` interface contains the `Headers` object associated -with the request. - -## Value - -A `Headers` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/json.mdx b/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/json.mdx deleted file mode 100644 index 3403848c30..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/json.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.json() - -The **`json()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A `Promise` that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/method.mdx b/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/method.mdx deleted file mode 100644 index 2a27fae32d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/method.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.method - -The **`method`** read-only property of the -`Request` interface contains the request's method (`GET`, `POST`, etc.) - -## Value - -A `String` indicating the method of the request. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/setManualFramingHeaders.mdx b/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/setManualFramingHeaders.mdx deleted file mode 100644 index ac6a403a55..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/setManualFramingHeaders.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.setManualFramingHeaders() - -The **`setManualFramingHeaders()`** method of the `Request` interface controls how the framing headers should be determined. - -By default the framing headers are set to "automatic" mode, which means they are created based on the body of the associated Request instance. -In "automatic" mode, a `Content-Length` is used when the size of the body can be determined before it is sent. -Requests sent in streaming mode, where headers are sent immediately but the content of the body is streamed later, will receive a `Transfer-Encoding: chunked` to accommodate the dynamic generation of the body. -In "manual" mode, any `Content-Length` or `Transfer-Encoding` headers will be honored. -You must ensure that those headers have correct values permitted by the [HTTP/1.1 specification](https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.1). -If the provided headers are not permitted by the specification, the headers will revert to "automatic" mode and a diagnostic message will be logged about what was wrong. -If a `Content-Length` is permitted by the specification, but the value does not match the size of the actual body, the body will either be truncated (if it is too long), or the connection will be hung up early (if it is too short). - -## Syntax - -## Syntax - -```js -setManualFramingHeaders(manual) -``` - -### Parameters - -- `manual` _: boolean_ - - : Whether or not to use "manual" mode for the framing headers. - -### Return value - -`undefined`. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/text.mdx b/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/text.mdx deleted file mode 100644 index 8284cb2bb1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/text.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.text() - -The **`text()`** method of the `Request` interface -reads the request body and returns it as a promise that resolves with a `String`. -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a `String`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/url.mdx b/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/url.mdx deleted file mode 100644 index fb0eae24df..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Request/prototype/url.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Request.url - -The **`url`** read-only property of the `Request` interface contains the URL of the request. - -## Value - -A string indicating the URL of the request. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/Response/Response.mdx b/documentation/versioned_docs/version-3.9.0/globals/Response/Response.mdx deleted file mode 100644 index 0e0a174fac..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Response/Response.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response() - -The **`Response()`** constructor creates a new `Response` object. - -## Syntax - -```js -new Response() -new Response(body) -new Response(body, options) -``` - -### Parameters - -- `body` _**optional**_ - - - : An object defining a body for the response. This can be `null` (which is - the default value), or one of: - - - [`ArrayBuffer`](../../globals/ArrayBuffer/ArrayBuffer.mdx) - - `TypedArray` - - [`DataView`](../../globals/DataView/DataView.mdx) - - [`ReadableStream`](../../globals/ReadableStream/ReadableStream.mdx) - - [`URLSearchParams`](../../globals/URLSearchParams/URLSearchParams.mdx) - - [`String`](../../globals/String/String.mdx) - - string literal - -- `options` _**optional**_ - - - : An options object containing any custom settings that you want to apply to the - response, or an empty object (which is the default value). The possible options are: - - - `status` - - : The status code for the response, e.g., `200`. - - `statusText` - - : The status message associated with the status code, - e.g., `OK`. - - `headers` - - : Any headers you want to add to your response, contained - within a [`Headers`](../../globals/Headers/Headers.mdx) object or object literal of - [`String`](../../globals/String/String.mdx) key/value pairs. - - `manualFramingHeaders`_: boolean_ _**optional**_ _**Fastly-specific**_ - - : The default value is `false`, which means that the framing headers are automatically created based on the message body. - In "automatic" mode, a `Content-Length` is used when the size of the body can be determined before it is sent. - Responses sent in streaming mode, where headers are sent immediately but the content of the body is streamed later, will receive a `Transfer-Encoding: chunked` to accommodate the dynamic generation of the body. - In "manual" mode, any `Content-Length` or `Transfer-Encoding` headers will be honored. - You must ensure that those headers have correct values permitted by the [HTTP/1.1 specification](https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.1). - If the provided headers are not permitted by the specification, the headers will revert to "automatic" mode and a diagnostic message will be logged about what was wrong. - If a `Content-Length` is permitted by the specification, but the value does not match the size of the actual body, the body will either be truncated (if it is too long), or the connection will be hung up early (if it is too short). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/arrayBuffer.mdx b/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/arrayBuffer.mdx deleted file mode 100644 index 18abed2703..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/arrayBuffer.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.arrayBuffer() - -The **`arrayBuffer()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface -takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise -that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). - -## Syntax - -```js -arrayBuffer() -``` - -### Parameters - -None. - -### Return value - -A promise that resolves with an [`ArrayBuffer`](../../../globals/ArrayBuffer/ArrayBuffer.mdx). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/body.mdx b/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/body.mdx deleted file mode 100644 index 487ad32866..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/body.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.body - -The **`body`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx) of the body contents. - -## Value - -A [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx), or else `null` for any `Response` object [constructed](../../../globals/Response/Response.mdx) with a null `body` property, or for any actual HTTP response that has no body. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/bodyUsed.mdx b/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/bodyUsed.mdx deleted file mode 100644 index 8c6e0c20b9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/bodyUsed.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.bodyUsed - -The **`bodyUsed`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface is a boolean value that indicates whether the body has been read yet. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/headers.mdx b/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/headers.mdx deleted file mode 100644 index 8fe7894183..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/headers.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.headers - -The **`headers`** read-only property of the -[`Response`](../../../globals/Response/Response.mdx) interface contains the [`Headers`](../../../globals/Headers/Headers.mdx) object associated -with the response. - -## Value - -A [`Headers`](../../Headers/Headers.mdx) object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/json.mdx b/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/json.mdx deleted file mode 100644 index 65b2960a62..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/json.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.json() - -The **`json()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes -a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. It returns a promise which -resolves with the result of parsing the body text as JSON. - -Note that despite the method being named `json()`, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object. - -## Syntax - -```js -json() -``` - -### Parameters - -None. - -### Return value - -A [`Promise`](../../../globals/Promise/Promise.mdx) that resolves to a JavaScript object. This object could be -anything that can be represented by JSON — an object, an array, a string, a number… diff --git a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/ok.mdx b/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/ok.mdx deleted file mode 100644 index 64b6459caf..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/ok.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.ok - -The **`ok`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not. - -## Value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/status.mdx b/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/status.mdx deleted file mode 100644 index fd40bd0119..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/status.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.status - -The **`status`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the HTTP status code of the response. - -For example, `200` for success, `404` if the resource could not be found. - -## Value - -An unsigned short number. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/statusText.mdx b/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/statusText.mdx deleted file mode 100644 index b42a2d2d28..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/statusText.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.statusText - -The **`statusText`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the status message corresponding to the HTTP status code in [`status`](../../../globals/Response/prototype/status.mdx). - -For example, this would be `OK` for a status code `200`, `Continue` for `100`, `Not Found` for `404`. - -## Value - -A [`String`](../../../globals/String/String.mdx) containing the HTTP status message associated with the response. -The default value is "". diff --git a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/text.mdx b/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/text.mdx deleted file mode 100644 index 97137ffebc..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/text.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.text() - -The **`text()`** method of the [`Response`](../../../globals/Response/Response.mdx) interface takes a [`Response`](../../../globals/Response/Response.mdx) stream and reads it to completion. -It returns a promise that resolves with a [`String`](../../../globals/String/String.mdx). -The response is _always_ decoded using UTF-8. - -## Syntax - -```js -text() -``` - -### Parameters - -None. - -### Return value - -A Promise that resolves with a [`String`](../../../globals/String/String.mdx). - diff --git a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/url.mdx b/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/url.mdx deleted file mode 100644 index f05e0bc969..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Response/prototype/url.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.url - -The **`url`** read-only property of the [`Response`](../../../globals/Response/Response.mdx) interface contains the URL of the response. -The value of the `url` property will be the final URL obtained after any redirects. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/Response/redirect.mdx b/documentation/versioned_docs/version-3.9.0/globals/Response/redirect.mdx deleted file mode 100644 index 0d60d59a86..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Response/redirect.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# Response.redirect() - -The **`redirect()`** static method of the `Response` interface returns a `Response` resulting in a redirect to the specified URL. - -## Syntax - -```js -Response.redirect(url) -Response.redirect(url, status) -``` - -### Parameters - -- `url` - - : The URL that the new response is to originate from. -- `status` __optional__ - - : An optional status code for the response (e.g., `302`.) - -### Return value - -A `Response` object. - -### Exceptions - -- `RangeError` - - : The specified status is not a redirect status. -- `TypeError` - - : The specified URL is invalid. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Response/setManualFramingHeaders.mdx b/documentation/versioned_docs/version-3.9.0/globals/Response/setManualFramingHeaders.mdx deleted file mode 100644 index 15b3ed3e3c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Response/setManualFramingHeaders.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Response.setManualFramingHeaders() - -The **`setManualFramingHeaders()`** method of the `Response` interface controls how the framing headers should be determined. - -By default the framing headers are set to "automatic" mode, which means they are created based on the body of the associated Response instance. -In "automatic" mode, a `Content-Length` is used when the size of the body can be determined before it is sent. -Responses sent in streaming mode, where headers are sent immediately but the content of the body is streamed later, will receive a `Transfer-Encoding: chunked` to accommodate the dynamic generation of the body. -In "manual" mode, any `Content-Length` or `Transfer-Encoding` headers will be honored. -You must ensure that those headers have correct values permitted by the [HTTP/1.1 specification](https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.1). -If the provided headers are not permitted by the specification, the headers will revert to "automatic" mode and a diagnostic message will be logged about what was wrong. -If a `Content-Length` is permitted by the specification, but the value does not match the size of the actual body, the body will either be truncated (if it is too long), or the connection will be hung up early (if it is too short). - -## Syntax - -## Syntax - -```js -setManualFramingHeaders(manual) -``` - -### Parameters - -- `manual` _: boolean_ - - : Whether or not to use "manual" mode for the framing headers. - -### Return value - -`undefined`. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx b/documentation/versioned_docs/version-3.9.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx deleted file mode 100644 index 3477966947..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/RsaHashedImportParams/RsaHashedImportParams.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# RsaHashedImportParams - -The **`RsaHashedImportParams`** dictionary represents the object that should be passed as the `algorithm` parameter into `SubtleCrypto.importKey()`, when importing any RSA-based key pair. - -## Instance properties - -- `name` - - : A string. This should be set to `RSASSA-PKCS1-v1_5`. - -- `hash` - - : A string representing the name of the digest function to use. This can be one of `SHA-256`, `SHA-384`, or `SHA-512`. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/Set/@@species.mdx b/documentation/versioned_docs/version-3.9.0/globals/Set/@@species.mdx deleted file mode 100644 index 06bbf2d6a0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Set/@@species.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# get Set\[Symbol.species] - -The **`Set[Symbol.species]`** accessor property is an unused accessor property specifying how to copy `Set` objects. - -## Syntax - -```js -Set[Symbol.species] -``` - -### Return value - -The value of the constructor (`this`) on which `get Symbol.species` was called. The return value is used to construct copied `Set` instances. - -## Description - -The `Symbol.species` accessor property returns the default constructor for `Set` objects. Subclass constructors may override it to change the constructor assignment. - -> **Note:** This property is currently unused by all `Set` methods. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Set/Set.mdx b/documentation/versioned_docs/version-3.9.0/globals/Set/Set.mdx deleted file mode 100644 index 37fca9e088..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Set/Set.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set() - -The **`Set` constructor** lets you -create `Set` objects that store unique values of any type, whether [primitive values](https://developer.mozilla.org/docs/Glossary/Primitive) or object -references. - -## Syntax - -```js -new Set() -new Set(iterable) -``` - -> **Note:** `Set()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `Set`. - - If you don't specify this parameter, or its value is `null`, the new - `Set` is empty. - -### Return value - -A new `Set` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/@@iterator.mdx deleted file mode 100644 index b389579ebd..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/@@iterator.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype\[Symbol.iterator]() - -The **`[Symbol.iterator`** method of a `Set` object implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows sets to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the values of the set. - -The initial value of this property is the same function object as the initial value of the [`Set.prototype.values`](../../../globals/Set/prototype/values.mdx) property. - -## Syntax - -```js -set[Symbol.iterator]() -``` - -### Return value - -The same return value as [`Set.prototype.values()`](../../../globals/Set/prototype/values.mdx): a new iterable iterator object that yields the values of the set. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/add.mdx b/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/add.mdx deleted file mode 100644 index 139e70709d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/add.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.add() - -The **`add()`** method inserts a new element with a specified value in to a `Set` object, if there isn't an element with the same value already in the `Set`. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- `value` - - : The value of the element to add to the `Set` object. - -### Return value - -The `Set` object with added value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/clear.mdx b/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/clear.mdx deleted file mode 100644 index bc99c4dabb..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/clear.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.clear() - -The **`clear()`** method removes all elements from a -`Set` object. - -## Syntax - -```js -clear() -``` - -### Return value - -[`undefined`](../../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/delete.mdx b/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/delete.mdx deleted file mode 100644 index 9f1e322757..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.delete() - -The **`delete()`** method removes a specified value from a -`Set` object, if it is in the set. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : The value to remove from `Set`. - -### Return value - -Returns `true` if `value` was already in -`Set`; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/entries.mdx b/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/entries.mdx deleted file mode 100644 index f1ea9a4ae8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/entries.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.entries() - -The **`entries()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object -that contains **an array of `[value, value]`** for each element -in the `Set` object, in insertion order. For `Set` objects there -is no `key` like in `Map` objects. However, to keep the API -similar to the `Map` object, each _entry_ has the same value for its -_key_ and _value_ here, so that an array `[value, value]` is -returned. - -## Syntax - -```js -entries() -``` - -### Return value - -A new iterator object that contains an array of `[value, value]` for each -element in the given `Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/forEach.mdx b/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/forEach.mdx deleted file mode 100644 index fb2a64fe45..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/forEach.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.forEach() - -The **`forEach()`** method executes a provided function once -for each value in the `Set` object, in insertion order. - -## Syntax - -```js -// Arrow function -forEach(() => { /* ... */ } ) -forEach((value) => { /* ... */ } ) -forEach((value, key) => { /* ... */ } ) -forEach((value, key, set) => { /* ... */ } ) - -// Callback function -forEach(callbackFn) -forEach(callbackFn, thisArg) - -// Inline callback function -forEach(function() { /* ... */ }) -forEach(function(value) { /* ... */ }) -forEach(function(value, key) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }) -forEach(function(value, key, set) { /* ... */ }, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute for each element, taking three arguments: - - - `value`, `key` - - : The current element being processed in the `Set`. As there are no - keys in `Set`, the value is passed for both arguments. - - `set` - - : The `Set` object which `forEach()` was called upon. - -- `thisArg` - - : Value to use as `this` when executing `callbackFn`. - -### Return value - -[`undefined`](../../../globals/undefined.mdx). - -## Description - -The `forEach()` method executes the provided -`callback` once for each value which actually exists in the -`Set` object. It is not invoked for values which have been deleted. However, -it is executed for values which are present but have the value `undefined`. - -`callback` is invoked with **three arguments**: - -- the **element value** -- the **element key** -- the **`Set` object being traversed** - -There are no keys in `Set` objects, however, so the first two arguments are -both **values** contained in the [Set](../../../globals/Set/Set.mdx). This is to make it -consistent with other `forEach()` methods for [`Map.prototype.forEach()`](../../../globals/Map/prototype/forEach.mdx) and [`Array.prototype.forEach()`](../../../globals/Array/prototype/forEach.mdx). - -If a `thisArg` parameter is provided to `forEach()`, -it will be passed to `callback` when invoked, for use as its -`this` value. Otherwise, the value `undefined` will be passed for -use as its `this` value. The `this` value ultimately observable by -`callback` is determined according to -[the usual rules for determining the `this` seen by a function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this). - -Each value is visited once, except in the case when it was deleted and re-added before -`forEach()` has finished. `callback` is not invoked for -values deleted before being visited. New values added before `forEach()` has -finished will be visited. - -`forEach()` executes the `callback` function once for -each element in the `Set` object; it does not return a value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/has.mdx b/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/has.mdx deleted file mode 100644 index 6a4062c237..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/has.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified value exists in a `Set` object or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : The value to test for presence in the `Set` object. - -### Return value - -Returns `true` if an element with the specified value exists in the `Set` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/keys.mdx b/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/keys.mdx deleted file mode 100644 index 866f2d584b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/keys.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.keys() - -The **`keys()`** method is an alias for the [`values()`](../../../globals/Set/prototype/values.mdx) method. - -## Syntax - -```js -keys() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/size.mdx b/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/size.mdx deleted file mode 100644 index 26435d50ac..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/size.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.size - -The **`size`** accessor property returns the number of (unique) elements in a [Set](../../../globals/Set/Set.mdx) object. - -## Description - -The value of `size` is an integer representing how many entries the `Set` object has. A set accessor function for `size` is `undefined`; you cannot change this property. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/values.mdx b/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/values.mdx deleted file mode 100644 index 8b6f0526d1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Set/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Set.prototype.values() - -The **`values()`** method returns a new [Iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) object that -contains the values for each element in the `Set` object in insertion order. - -> **Note:** The **`keys()`** method is an alias -> for this method (for similarity with [Map](../../../globals/Map/Map.mdx) objects), hence the -> `keys()` page redirecting here. It behaves exactly the same and returns -> **values** of `Set` elements. - -## Syntax - -```js -values() -``` - -### Return value - -A new iterator object containing the values for each element in the given -`Set`, in insertion order. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/String.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/String.mdx deleted file mode 100644 index 2b514016f2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/String.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String() constructor - -The **`String`** constructor is used to create a new -`String` object. When called instead as a function, it performs type -conversion to a "primitive string" which is usually more -useful. - -## Syntax - -```js -new String(thing) -String(thing) -``` - -> **Note:** `String()` can be called with or without `new`, but with different effects. See [Return value](#return_value). - -### Parameters - -- `thing` - - : Anything to be converted to a string. - -### Return value - -When `String` is called as a constructor (with `new`), it creates a `String` object, which is **not** a primitive. - -When `String` is called as a function, it coerces the parameter to a string primitive. `Symbol` values would be converted to `"Symbol(description)"`, where `description` is the [description](../../globals/Symbol/prototype/description.mdx) of the Symbol, instead of throwing. - -> **Warning:** You should rarely find yourself using `String` as a constructor. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/fromCharCode.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/fromCharCode.mdx deleted file mode 100644 index 84998b25a0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/fromCharCode.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCharCode() - -The static **`String.fromCharCode()`** method returns a string -created from the specified sequence of UTF-16 code units. - -## Syntax - -```js -String.fromCharCode(num1) -String.fromCharCode(num1, num2) -String.fromCharCode(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of numbers that are UTF-16 code units. The range is between - `0` and `65535` (`0xFFFF`). Numbers greater than - `0xFFFF` are truncated. No validity checks are performed. - -### Return value - -A string of length `N` consisting of the -`N` specified UTF-16 code units. - -## Description - -This method returns a string and not a `String` object. - -Because `fromCharCode()` is a static method of `String`, you -always use it as `String.fromCharCode()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/fromCodePoint.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/fromCodePoint.mdx deleted file mode 100644 index 44d3c6c199..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/fromCodePoint.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.fromCodePoint() - -The static **`String.fromCodePoint()`** method returns a string -created by using the specified sequence of code points. - -## Syntax - -```js -String.fromCodePoint(num1) -String.fromCodePoint(num1, num2) -String.fromCodePoint(num1, num2, /* …, */ numN) -``` - -### Parameters - -- `num1, ..., numN` - - : A sequence of code points. - -### Return value - -A string created by using the specified sequence of code points. - -### Exceptions - -- A `RangeError` is thrown if an invalid Unicode - code point is given (e.g. `"RangeError: NaN is not a valid code point"`). - -## Description - -This method returns a string (and _not_ a `String` object). - -Because `fromCodePoint()` is a static method of `String`, you -must call it as `String.fromCodePoint()`, rather than as a method of a -`String` object you created. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/@@iterator.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/@@iterator.mdx deleted file mode 100644 index 67c6e19671..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/@@iterator.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype\[Symbol.iterator]() - -The **`Symbol.iterator`** method of a string implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) and allows strings to be consumed by most syntaxes expecting iterables, such as the [spread syntax](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Spread_syntax) and [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) loops. It returns an iterator that yields the Unicode code points of the string value as individual strings. - -## Syntax - -```js -string[Symbol.iterator]() -``` - -### Return value - -A new iterable iterator object that yields the Unicode code points of the string value as individual strings. - -## Description - -Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved. - -```js -// "Backhand Index Pointing Right: Dark Skin Tone" -[..."👉🏿"]; // ['👉', '🏿'] -// splits into the basic "Backhand Index Pointing Right" emoji and -// the "Dark skin tone" emoji - -// "Family: Man, Boy" -[..."👨‍👦"]; // [ '👨', '‍', '👦' ] -// splits into the "Man" and "Boy" emoji, joined by a ZWJ -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/at.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/at.mdx deleted file mode 100644 index 515be4a39b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/at.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.at() - -The **`at()`** method takes an integer value and returns a `('String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character. - -## Syntax - -```js -at(index) -``` - -### Parameters - -- `index` - - : The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e. if a negative number is used, the character returned will be found by counting back from the end of the string. - -### Return value - -`('String` consisting of the single UTF-16 code unit located at the specified position. Returns [`undefined`](../../../globals/undefined.mdx) if the given index can not be found. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/charAt.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/charAt.mdx deleted file mode 100644 index 84a45f2e65..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/charAt.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charAt() - -The `String` object's -**`charAt()`** method returns a new string consisting of the -single UTF-16 code unit located at the specified offset into the string. - -## Syntax - -```js -charAt(index) -``` - -### Parameters - -- `index` - - : An integer between `0` and `str.length - 1`. If the - `index` cannot be converted to the integer or no - `index` is provided, the default is `0`, so the first - character of `str` is returned. - -### Return value - -A string representing the character (exactly one UTF-16 code unit) at the specified -`index`. If `index` is out of range, -`charAt()` returns an empty string. - -## Description - -Characters in a string are indexed from left to right. The index of the first character -is `0`, and the index of the last character—in a string called -`stringName` is `stringName.length - 1`. If -the `index` you supply is out of this range, JavaScript returns an -empty string. - -If no `index` is provided to `charAt()`, the default -is `0`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/charCodeAt.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/charCodeAt.mdx deleted file mode 100644 index 7d410fea17..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/charCodeAt.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.charCodeAt() - -The **`charCodeAt()`** method returns -an integer between `0` and `65535` representing the UTF-16 code -unit at the given index. - -The UTF-16 code unit matches the Unicode code point for code points which can be -represented in a single UTF-16 code unit. If the Unicode code point cannot be -represented in a single UTF-16 code unit (because its value is greater than -`0xFFFF`) then the code unit returned will be _the first part of a -surrogate pair_ for the code point. If you want the entire code point value, use -[`codePointAt()`](../../../globals/String/prototype/codePointAt.mdx). - -## Syntax - -```js -charCodeAt(index) -``` - -### Parameters - -- `index` - - : An integer greater than or equal to `0` and less than the - `length` of the string. If `index` is not a number, - it defaults to `0`. - -### Return value - -A number representing the UTF-16 code unit value of the character at the given -`index`. If `index` is out of range, -`charCodeAt()` returns `NaN`. - -## Description - -Unicode code points range from `0` to `1114111` -(`0x10FFFF`). The first 128 Unicode code points are a direct match of the -ASCII character encoding. (For information on Unicode, see [UTF-16 characters, Unicode codepoints, and grapheme clusters](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters).) - -> **Note:** `charCodeAt()` will always return a value that is -> less than `65536`. This is because the higher code points are represented -> by _a pair_ of (lower valued) "surrogate" pseudo-characters which are used to -> comprise the real character. -> -> Because of this, in order to examine (or reproduce) the full character for individual -> character values of `65536` or greater, for such characters, it is -> necessary to retrieve not only `charCodeAt(i)`, but also -> `charCodeAt(i+1)` (as if manipulating a string with two -> letters), or to use `codePointAt(i)` instead. See examples 2 and -> 3 (below). - -`charCodeAt()` returns `NaN` if the given -index is less than `0`, or if it is equal to or greater than the -`length` of the string. - -Backward compatibility: In historic versions (like JavaScript 1.2) the -`charCodeAt()` method returns a number indicating the ISO-Latin-1 codeset -value of the character at the given index. The ISO-Latin-1 codeset ranges from -`0` to `255`. The first `0` to `127` are a -direct match of the ASCII character set. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/codePointAt.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/codePointAt.mdx deleted file mode 100644 index bbe41425a8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/codePointAt.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.codePointAt() - -The **`codePointAt()`** method returns a non-negative integer -that is the Unicode code point value at the given position. -Note that this function does not give the nth code point in a string, -but the code point starting at the specified string index. - -## Syntax - -```js -codePointAt(pos) -``` - -### Parameters - -- `pos` - - : Position of an element in `str` to return the code point value - from. - -### Return value - -A decimal number representing the code point value of the character at the given `pos`. - -- If there is no element at `pos`, returns [`undefined`](../../../globals/undefined.mdx). -- If the element at `pos` is a UTF-16 high surrogate, returns the code point of the surrogate _pair_. -- If the element at `pos` is a UTF-16 low surrogate, returns _only_ the low surrogate code point. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/concat.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/concat.mdx deleted file mode 100644 index 5f0eef6238..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/concat.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.concat() - -The **`concat()`** method concatenates -the string arguments to the calling string and returns a new string. - -## Syntax - -```js -concat(str1) -concat(str1, str2) -concat(str1, str2, /* …, */ strN) -``` - -### Parameters - -- `strN` - - : One or more strings to concatenate to `str`. - -### Return value - -A new string containing the combined text of the strings provided. - -## Description - -The `concat()` function concatenates the string arguments to the calling -string and returns a new string. Changes to the original string or the returned string -don't affect the other. - -If the arguments are not of the type string, they are converted to string values before -concatenating. - -The `concat()` method is very similar to the [addition/string concatenation operators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition) (`+`, `+=`), except that `concat()` [coerces its arguments directly to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion), while addition coerces its operands to primitives first. For more information, see the reference page for the [`+` operator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Addition). diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/endsWith.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/endsWith.mdx deleted file mode 100644 index 3f211e8301..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/endsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.endsWith() - -The **`endsWith()`** method determines whether a string ends with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -endsWith(searchString) -endsWith(searchString, endPosition) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the end of `str`. Cannot be a regex. -- `endPosition` _**optional**_ - - : The end position at which `searchString` is expected to be found (the index of `searchString`'s last character plus 1). Defaults to `str.length`. - -### Return value - -**`true`** if the given characters are found at the end of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string ends with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/includes.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/includes.mdx deleted file mode 100644 index 34e2b98b91..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/includes.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.includes() - -The **`includes()`** method performs a case-sensitive search to determine whether one string may be found within another string, returning `true` or `false` as appropriate. - -## Syntax - -```js -includes(searchString) -includes(searchString, position) -``` - -### Parameters - -- `searchString` - - : A string to be searched for within `str`. Cannot be a regex. -- `position` _**optional**_ - - : The position within the string at which to begin searching for `searchString`. (Defaults to `0`.) - -### Return value - -**`true`** if the search string is found anywhere within the given string; otherwise, **`false`** if not. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` is a regex. - -## Description - -This method lets you determine whether or not a string includes another string. - -### Case-sensitivity - -The `includes()` method is case sensitive. For example, the following expression returns `false`: - -```js -"Blue Whale".includes("blue"); // returns false -``` - -You can work around this constraint by transforming both the original string and the search string to all lowercase: - -```js -"Blue Whale".toLowerCase().includes("blue"); // returns true -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/indexOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/indexOf.mdx deleted file mode 100644 index 9c0005cdbf..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/indexOf.mdx +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.indexOf() - -The **`indexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the first occurrence of the specified substring. Given a second argument: a number, the method returns the first occurrence of the specified substring at an index greater than or equal to the specified number. - -## Syntax - -```js -indexOf(searchString) -indexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".indexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".indexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the first occurrence of the specified substring at a position greater than or equal to `position`, which defaults to `0`. If `position` is greater than the length of the calling string, the method doesn't search the calling string at all. If `position` is less than zero, the method behaves as it would if `position` were `0`. - - - `'hello world hello'.indexOf('o', -5)` returns `4` — because it causes the method to behave as if the second argument were `0`, and the first occurrence of `o` at a position greater or equal to `0` is at position `4`. - - - `'hello world hello'.indexOf('world', 12)` returns `-1` — because, while it's true the substring `world` occurs at index `6`, that position is not greater than or equal to `12`. - - - `'hello world hello'.indexOf('o', 99)` returns `-1` — because `99` is greater than the length of `hello world hello`, which causes the method to not search the string at all. - -### Return value - -The index of the first occurrence of `searchString` found, or `-1` if not found. - -#### Return value when using an empty search string - -Searching for an empty search string produces strange results. With no second argument, or with a second argument whose value is less than the calling string's length, the return value is the same as the value of the second argument: - -```js -"hello world".indexOf(""); // returns 0 -"hello world".indexOf("", 0); // returns 0 -"hello world".indexOf("", 3); // returns 3 -"hello world".indexOf("", 8); // returns 8 -``` - -However, with a second argument whose value is greater than or equal to the string's length, the return value is the string's length: - -```js -"hello world".indexOf("", 11); // returns 11 -"hello world".indexOf("", 13); // returns 11 -"hello world".indexOf("", 22); // returns 11 -``` - -In the former instance, the method behaves as if it found an empty string just after the position specified in the second argument. In the latter instance, the method behaves as if it found an empty string at the end of the calling string. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"Blue Whale".indexOf("Blue"); // returns 0 -"Blue Whale".indexOf("Blute"); // returns -1 -"Blue Whale".indexOf("Whale", 0); // returns 5 -"Blue Whale".indexOf("Whale", 5); // returns 5 -"Blue Whale".indexOf("Whale", 7); // returns -1 -"Blue Whale".indexOf(""); // returns 0 -"Blue Whale".indexOf("", 9); // returns 9 -"Blue Whale".indexOf("", 10); // returns 10 -"Blue Whale".indexOf("", 11); // returns 10 -``` - -The `indexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale".indexOf("blue"); // returns -1 -``` - -### Checking occurrences - -When checking if a specific substring occurs within a string, the correct way to check is test whether the return value is `-1`: - -```js -"Blue Whale".indexOf("Blue") !== -1; // true; found 'Blue' in 'Blue Whale' -"Blue Whale".indexOf("Bloe") !== -1; // false; no 'Bloe' in 'Blue Whale' -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/lastIndexOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/lastIndexOf.mdx deleted file mode 100644 index a98059f612..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/lastIndexOf.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.lastIndexOf() - -The **`lastIndexOf()`** method, given one argument: a substring to search for, searches the entire calling string, and returns the index of the last occurrence of the specified substring. Given a second argument: a number, the method returns the last occurrence of the specified substring at an index less than or equal to the specified number. - -## Syntax - -```js -lastIndexOf(searchString) -lastIndexOf(searchString, position) -``` - -### Parameters - -- `searchString` - - - : Substring to search for, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - - If the method is called with no arguments, `searchString` is coerced to `"undefined"`. Therefore,`"undefined".lastIndexOf()` returns `0` — because the substring `"undefined"` is found at position `0` in the string `"undefined"`. But `"undefine".lastIndexOf()`, returns `-1` — because the substring `"undefined"` is not found in the string `"undefine"`. - -- `position` _**optional**_ - - - : The method returns the index of the last occurrence of the specified substring at a position less than or equal to `position`, which defaults to `+Infinity`. If `position` is greater than the length of the calling string, the method searches the entire string. If `position` is less than `0`, the behavior is the same as for `0` — that is, the method looks for the specified substring only at index `0`. - - - `'hello world hello'.lastIndexOf('world', 4)` returns `-1` — because, while the substring `world` does occurs at index `6`, that position is not less than or equal to `4`. - - - `'hello world hello'.lastIndexOf('hello', 99)` returns `12` — because the last occurrence of `hello` at a position less than or equal to `99` is at position `12`. - - - `'hello world hello'.lastIndexOf('hello', 0)` and `'hello world hello'.lastIndexOf('hello', -5)` both return `0` — because both cause the method to only look for `hello` at index `0`. - -### Return value - -The index of the last occurrence of `searchString` found, or `-1` if not found. - -## Description - -Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1. - -```js -"canal".lastIndexOf("a"); // returns 3 -"canal".lastIndexOf("a", 2); // returns 1 -"canal".lastIndexOf("a", 0); // returns -1 -"canal".lastIndexOf("x"); // returns -1 -"canal".lastIndexOf("c", -5); // returns 0 -"canal".lastIndexOf("c", 0); // returns 0 -"canal".lastIndexOf(""); // returns 5 -"canal".lastIndexOf("", 2); // returns 2 -``` - -### Case-sensitivity - -The `lastIndexOf()` method is case sensitive. For example, the following -expression returns `-1`: - -```js -"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/length.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/length.mdx deleted file mode 100644 index 919059c0b2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/length.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.length - -The **`length`** data property of a string contains the length of the string in UTF-16 code units. - -## Value - -A non-negative integer. - -## Description - -This property returns the number of code units in the string. JavaScript uses [UTF-16](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters) encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode characters in the string. For common scripts like Latin, Cyrillic, wellknown CJK characters, etc., this should not be an issue, but if you are working with certain scripts, such as emojis, [mathematical symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols), or obscure Chinese characters, you may need to account for the difference between code units and characters. - -The language specification requires strings to have a maximum length of 253 - 1 elements, which is the upper limit for [precise integers](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). However, a string with this length needs 16384TiB of storage, which cannot fit in any reasonable device's memory, so implementations tend to lower the threshold, which allows the string's length to be conveniently stored in a 32-bit integer. - -- In V8 (used by Chrome and Node), the maximum length is 229 - 24 (\~1GiB). On 32-bit systems, the maximum length is 228 - 16 (\~512MiB). -- In Firefox, the maximum length is 230 - 2 (\~2GiB). Before Firefox 65, the maximum length was 228 - 1 (\~512MiB). -- In Safari, the maximum length is 231 - 1 (\~4GiB). - -For an empty string, `length` is 0. - -The static property `String.length` is unrelated to the length of strings. It's the [arity](../../../globals/Function/prototype/length.mdx) of the `String` function (loosely, the number of formal parameters it has), which is 1. - -Since `length` counts code units instead of characters, if you want to get the number of characters, you can first split the string with its [iterator](../../../globals/String/prototype/@@iterator.mdx), which iterates by characters: - -```js -function getCharacterLength(str) { - // The string iterator that is used here iterates over characters, - // not mere code units - return [...str].length; -} - -console.log(getCharacterLength("A\uD87E\uDC04Z")); // 3 -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/localeCompare.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/localeCompare.mdx deleted file mode 100644 index dd4bf333ae..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/localeCompare.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.localeCompare() - -The **`localeCompare()`** method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. In implementations with [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) support, this method simply calls `Intl.Collator`. - -## Syntax - -```js -localeCompare(compareString) -localeCompare(compareString, locales) -localeCompare(compareString, locales, options) -``` - -### Parameters - -The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used. - -In implementations that support the [`Intl.Collator` API](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator), these parameters correspond exactly to the [`Intl.Collator()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) constructor's parameters. Implementations without `Intl.Collator` support are asked to ignore both parameters, making the comparison result returned entirely implementation-dependent — it's only required to be _consistent_. - -- `compareString` - - : The string against which the `referenceStr` is compared. -- `locales` _**optional**_ - - - : A string with a BCP 47 language tag, or an array of such strings. Corresponds to the [`locales`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#locales) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored and the host's locale is usually used. - -- `options` _**optional**_ - - - : An object adjusting the output format. Corresponds to the [`options`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) parameter of the `Intl.Collator()` constructor. - - In implementations without `Intl.Collator` support, this parameter is ignored. - -See the [`Intl.Collator()` constructor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) for details on the `locales` and `options` parameters and how to use them. - -### Return value - -A **negative** number if `referenceStr` occurs before `compareString`; **positive** if the `referenceStr` occurs after `compareString`; `0` if they are equivalent. - -In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(locales, options).compare(referenceStr, compareString)`. - -## Description - -Returns an integer indicating whether the `referenceStr` comes -before, after or is equivalent to the `compareString`. - -- Negative when the `referenceStr` occurs before - `compareString` -- Positive when the `referenceStr` occurs after - `compareString` -- Returns `0` if they are equivalent - -> **Warning:** Do not rely on exact return values of `-1` or `1`! -> -> Negative and positive integer results vary between browsers (as well as between -> browser versions) because the W3C specification only mandates negative and positive -> values. Some browsers may return `-2` or `2`, or even some other -> negative or positive value. - -## Performance - -When comparing large numbers of strings, such as in sorting large arrays, it is better to create an [`Intl.Collator`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) object and use the function provided by its [`compare()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/compare) method. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/match.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/match.mdx deleted file mode 100644 index 3166f35959..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/match.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.match() - -The **`match()`** method retrieves the result of matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions). - -## Syntax - -```js -match(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.match`](../../../globals/Symbol/match.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - - If you don't give any parameter and use the `match()` method directly, you will get an `Array` with an empty string: `[""]`, because this is equivalent to `match(/(?:)/)`. - -### Return value - -An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) if no matches are found. - -- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not included. -- If the `g` flag is not used, only the first complete match and its related capturing groups are returned. In this case, `match()` will return the same result as `RegExp.prototype.exec()` (an array with some extra properties). - -## Description - -The implementation of `String.prototype.match` itself is very simple — it simply calls the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). - -- If you need to know if a string matches a regular expression `RegExp`, use `RegExp.prototype.test()`. -- If you only want the first match found, you might want to use `RegExp.prototype.exec()` instead. -- If you want to obtain capture groups and the global flag is set, you need to use `RegExp.prototype.exec()` or [`String.prototype.matchAll()`](../../../globals/String/prototype/matchAll.mdx) instead. - -For more information about the semantics of `match()` when a regex is passed, see [`RegExp.prototype[@@match]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match). diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/matchAll.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/matchAll.mdx deleted file mode 100644 index d0cf636557..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/matchAll.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.matchAll() - -The **`matchAll()`** method returns an iterator of all results matching a string against a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions), including [capturing groups](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Backreferences). - -## Syntax - -```js -matchAll(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.matchAll`](../../../globals/Symbol/matchAll.mdx) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.matchAll` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp, 'g')`. - - If `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes), then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -### Return value - -An [iterable iterator](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators) (which is not restartable) of matches. Each match is an array with the same shape as the return value of `RegExp.prototype.exec()`. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `regexp` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -The implementation of `String.prototype.matchAll` itself is very simple — it simply calls the `Symbol.matchAll` method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from [`RegExp.prototype[@@matchAll]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll). diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/padEnd.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/padEnd.mdx deleted file mode 100644 index 553e5ac242..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/padEnd.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padEnd() - -The **`padEnd()`** method pads the current string with a given -string (repeated, if needed) so that the resulting string reaches a given length. The -padding is applied from the end of the current string. - -## Syntax - -```js -padEnd(targetLength) -padEnd(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is lower than `str.length`, the - current string will be returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within - `targetLength`, it will be truncated: for left-to-right - languages the left-most part and for right-to-left languages the right-most will be - applied. The default value for this parameter is " " - (`U+0020`). - -### Return value - -A `String` of the specified `targetLength` with the -`padString` applied at the end of the current -`str`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/padStart.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/padStart.mdx deleted file mode 100644 index ad838d9282..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/padStart.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.padStart() - -The **`padStart()`** method pads the -current string with another string (multiple times, if needed) until the resulting -string reaches the given length. The padding is applied from the start of the -current string. - -## Syntax - -```js -padStart(targetLength) -padStart(targetLength, padString) -``` - -### Parameters - -- `targetLength` - - : The length of the resulting string once the current `str` has - been padded. If the value is less than `str.length`, then - `str` is returned as-is. -- `padString` _**optional**_ - - : The string to pad the current `str` with. If - `padString` is too long to stay within the - `targetLength`, it will be truncated from the end. - The default value is the unicode "space" character (U+0020). - -### Return value - -A `String` of the specified `targetLength` with -`padString` applied from the start. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/repeat.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/repeat.mdx deleted file mode 100644 index a6a4e0dc01..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/repeat.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.repeat() - -The **`repeat()`** method constructs and returns a new string -which contains the specified number of copies of the string on which it was called, -concatenated together. - -## Syntax - -```js -repeat(count) -``` - -### Parameters - -- `count` - - : An integer between `0` and - [`+Infinity`](../../../globals/Number/POSITIVE_INFINITY.mdx), indicating the - number of times to repeat the string. - -### Return value - -A new string containing the specified number of copies of the given string. - -### Exceptions - -- Throws a `RangeError` if repeat count is negative. -- Throws a `RangeError` if repeat count is infinity or overflows maximum string size. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/replace.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/replace.mdx deleted file mode 100644 index d60f4d1f65..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/replace.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replace() - -The **`replace()`** method returns a new string with one, some, or all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function called for each match. If `pattern` is a string, only the first occurrence will be replaced. The original string is left unchanged. - -## Syntax - -```js -replace(pattern, replacement) -``` - -### Parameters - -- `pattern` - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. -- `replacement` - - : Can be a string or a function. - - If it's a string, it will replace the substring matched by `pattern`. A number of special replacement patterns are supported; see the [Specifying a string as the replacement](#specifying_a_string_as_the_replacement) section below. - - If it's a function, it will be invoked for every match and its return value is used as the replacement text. The arguments supplied to this function are described in the [Specifying a function as the replacement](#specifying_a_function_as_the_replacement) section below. - -### Return value - -A new string, with one, some, or all matches of the pattern replaced by the specified replacement. - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -A string pattern will only be replaced once. To perform a global search and replace, use a regular expression with the `g` flag, or use [`replaceAll()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) instead. - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replace()`. In this case the behavior of `replace()` is entirely encoded by the `@@replace` method — for example, any mention of "capturing groups" in the description below is actually functionality provided by [`RegExp.prototype[@@replace]`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -If the `pattern` is an empty string, the replacement is prepended to the start of the string. - -```js -"xxx".replace("", "_"); // "_xxx" -``` - -A regexp with the `g` flag is the only case where `replace()` replaces more than once. For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replace()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). - -### Specifying a string as the replacement - -The replacement string can include the following special replacement patterns: - -| Pattern | Inserts | -| --------- | ---------------------------------------------------------------------------------------------- | -| `$$` | Inserts a `"$"`. | -| `$&` | Inserts the matched substring. | -| `` $` `` | Inserts the portion of the string that precedes the matched substring. | -| `$'` | Inserts the portion of the string that follows the matched substring. | -| `$n` | Inserts the `n`th (`1`-indexed) capturing group where `n` is a positive integer less than 100. | -| `$` | Inserts the named capturing group where `Name` is the group name. | - -`$n` and `$` are only available if the `pattern` argument is a `RegExp` object. If the `pattern` is a string, or if the corresponding capturing group isn't present in the regex, then the pattern will be replaced as a literal. If the group is present but isn't matched (because it's part of a disjunction), it will be replaced with an empty string. - -```js -"foo".replace(/(f)/, "$2"); -// "$2oo"; the regex doesn't have the second group - -"foo".replace("f", "$1"); -// "$1oo"; the pattern is a string, so it doesn't have any groups - -"foo".replace(/(f)|(g)/, "$2"); -// "oo"; the second group exists but isn't matched -``` - -### Specifying a function as the replacement - -You can specify a function as the second parameter. In this case, the function will be invoked after the match has been performed. The function's result (return value) will be used as the replacement string. - -> **Note:** The above-mentioned special replacement patterns do _not_ apply for strings returned from the replacer function. - -The function has the following signature: - -```js -function replacer(match, p1, p2, /* …, */ pN, offset, string, groups) { - return replacement; -} -``` - -The arguments to the function are as follows: - -- `match` - - : The matched substring. (Corresponds to `$&` above.) -- `p1, p2, …, pN` - - : The `n`th string found by a capture group (including named capturing groups), provided the first argument to `replace()` is a `RegExp` object. (Corresponds to `$1`, `$2`, etc. above.) For example, if the `pattern` is `/(\a+)(\b+)/`, then `p1` is the match for `\a+`, and `p2` is the match for `\b+`. If the group is part of a disjunction (e.g. `"abc".replace(/(a)|(b)/, replacer)`), the unmatched alternative will be `undefined`. -- `offset` - - : The offset of the matched substring within the whole string being examined. For example, if the whole string was `'abcd'`, and the matched substring was `'bc'`, then this argument will be `1`. -- `string` - - : The whole string being examined. -- `groups` - - : An object whose keys are the used group names, and whose values are the matched portions (`undefined` if not matched). Only present if the `pattern` contains at least one named capturing group. - -The exact number of arguments depends on whether the first argument is a `RegExp` object — and, if so, how many capture groups it has. - -The following example will set `newString` to `'abc - 12345 - #$*%'`: - -```js -function replacer(match, p1, p2, p3, offset, string) { - // p1 is non-digits, p2 digits, and p3 non-alphanumerics - return [p1, p2, p3].join(" - "); -} -const newString = "abc12345#$*%".replace(/([^\d]*)(\d*)([^\w]*)/, replacer); -console.log(newString); // abc - 12345 - #$*% -``` - -The function will be invoked multiple times for each full match to be replaced if the regular expression in the first parameter is global. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/replaceAll.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/replaceAll.mdx deleted file mode 100644 index 9ac0110372..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/replaceAll.mdx +++ /dev/null @@ -1,66 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.replaceAll() - -The **`replaceAll()`** method returns a new string with all matches of a `pattern` replaced by a `replacement`. The `pattern` can be a string or a `RegExp`, and the `replacement` can be a string or a function to be called for each match. The original string is left unchanged. - -## Syntax - -```js -replaceAll(pattern, replacement) -``` - -### Parameters - -- `pattern` - - - : Can be a string or an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method — the typical example being a [regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp). Any value that doesn't have the `Symbol.replace` method will be coerced to a string. - - If `pattern` is a regex, then it must have the global (`g`) flag set, or a [`TypeError`](../../../globals/TypeError/TypeError.mdx) is thrown. - -- `replacement` - - : Can be a string or a function. The replacement has the same semantics as that of [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx). - -### Return value - -A new string, with all matches of a pattern replaced by a replacement. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : Thrown if the `pattern` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes) that does not have the global (`g`) flag set (its [`flags`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/flags) property does not contain `"g"`). - -## Description - -This method does not mutate the string value it's called on. It returns a new string. - -Unlike [`String.prototype.replace()`](../../../globals/String/prototype/replace.mdx), this method would replace all occurrences of a string, not just the first one. This is especially useful if the string is not statically known, as calling the [`RegExp()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) constructor without escaping special characters may unintentionally change its semantics. - -```js -function unsafeRedactName(text, name) { - return text.replace(new RegExp(name, "g"), "[REDACTED]"); -} -function safeRedactName(text, name) { - return text.replaceAll(name, "[REDACTED]"); -} - -const report = - "A hacker called ha.*er used special characters in their name to breach the system."; - -console.log(unsafeRedactName(report, "ha.*er")); // "A [REDACTED]s in their name to breach the system." -console.log(safeRedactName(report, "ha.*er")); // "A hacker called [REDACTED] used special characters in their name to breach the system." -``` - -If `pattern` is an object with a [`Symbol.replace`](../../../globals/Symbol/replace.mdx) method (including `RegExp` objects), that method is called with the target string and `replacement` as arguments. Its return value becomes the return value of `replaceAll()`. In this case the behavior of `replaceAll()` is entirely encoded by the `Symbol.replace` method, and therefore will have the same result as `replace()` (apart from the extra input validation that the regex is global). - -If the `pattern` is an empty string, the replacement will be inserted in between every UTF-16 code unit, similar to [`String.prototype.split()`](../../../globals/String/prototype/split.mdx) behavior. - -```js -"xxx".replaceAll("", "_"); // "_x_x_x_" -``` - -For more information about how regex properties (especially the [sticky](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) flag) interact with `replaceAll()`, see [`RegExp.prototype[@@replace]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace). diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/search.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/search.mdx deleted file mode 100644 index b4d6a195f0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/search.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.search() - -The **`search()`** method executes a search for a match between a regular expression and this `String` object. - -## Syntax - -```js -search(regexp) -``` - -### Parameters - -- `regexp` - - - : A regular expression object, or any object that has a [`Symbol.search`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/search) method. - - If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. - -### Return value - -The index of the first match between the regular expression and the given string, or `-1` if no match was found. - -## Description - -The implementation of `String.prototype.search()` itself is very simple — it simply calls the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -The `g` flag of `regexp` has no effect on the `search()` result, and the search always happens as if the regex's `lastIndex` is 0. For more information on the behavior of `search()`, see [`RegExp.prototype[@@search]()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search). - -When you want to know whether a pattern is found, and _also_ know its index within a string, use `search()`. - -- If you only want to know if it exists, use the `RegExp.prototype.test()` method, which returns a boolean. -- If you need the content of the matched text, use `String.prototype.match()` or `RegExp.prototype.exec()`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/slice.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/slice.mdx deleted file mode 100644 index ed6fe2754a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/slice.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.slice() - -The **`slice()`** method extracts a section of a string and -returns it as a new string, without modifying the original string. - -## Syntax - -```js -slice(indexStart) -slice(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the extracted section of the string. - -## Description - -`slice()` extracts the text from one string and returns a new string. Changes to the text in one string do not affect the other string. - -`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(1, 4)` extracts the second character through the fourth character (characters indexed `1`, `2`, and `3`). - -- If `indexStart >= str.length`, an empty string is returned. -- If `indexStart < 0`, the index is counted from the end of the string. More formally, in this case, the substring starts at `max(indexStart + str.length, 0)`. -- If `indexStart` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), it's treated as `0`. -- If `indexEnd` is omitted, undefined, or cannot be converted to a number (using [`Number()`](../../../globals/Number/Number.mdx)), or if `indexEnd >= str.length`, `slice()` extracts to the end of the string. -- If `indexEnd < 0`, the index is counted from the end of the string. More formally, in this case, the substring ends at `max(indexEnd + str.length, 0)`. -- If `indexEnd <= indexStart` after normalizing negative values (i.e. `indexEnd` represents a character that's before `indexStart`), an empty string is returned. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/split.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/split.mdx deleted file mode 100644 index fac83451d0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/split.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.split() - -The **`split()`** method takes a pattern and divides a `String` into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array. - -## Syntax - -```js -split() -split(separator) -split(separator, limit) -``` - -### Parameters - -- `separator` _**optional**_ - - : The pattern describing where each split should occur. Can be a string or an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method — the typical example being a regular expression. If undefined, the original target string is returned wrapped in an array. -- `limit` _**optional**_ - - : A non-negative integer specifying a limit on the number of substrings to be included in the array. If provided, splits the string at each occurrence of the specified `separator`, but stops when `limit` entries have been placed in the array. Any leftover text is not included in the array at all. - - The array may contain fewer entries than `limit` if the end of the string is reached before the limit is reached. - - If `limit` is `0`, `[]` is returned. - -### Return value - -An `Array` of strings, split at each point where the `separator` occurs in the given string. - -## Description - -If `separator` is a non-empty string, the target string is split by all matches of the `separator` without including `separator` in the results. For example, a string containing tab separated values (TSV) could be parsed by passing a tab character as the separator, like `myString.split("\t")`. If `separator` contains multiple characters, that entire character sequence must be found in order to split. If `separator` appears at the beginning (or end) of the string, it still has the effect of splitting, resulting in an empty (i.e. zero length) string appearing at the first (or last) position of the returned array. If `separator` does not occur in `str`, the returned array contains one element consisting of the entire string. - -If `separator` is an empty string (`""`), `str` is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string. - -> **Note:** `"".split("")` is therefore the only way to produce an empty array when a string is passed as `separator`. - -> **Warning:** When the empty string (`""`) is used as a separator, the string is **not** split by _user-perceived characters_ ([grapheme clusters](https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries)) or unicode characters (codepoints), but by UTF-16 codeunits. This destroys [surrogate pairs](https://unicode.org/faq/utf_bom.html#utf16-2). See ["How do you get a string to a character array in JavaScript?" on StackOverflow](https://stackoverflow.com/questions/4547609/how-to-get-character-array-from-a-string/34717402#34717402). - -If `separator` is a regexp that matches empty strings, whether the match is split by UTF-16 code units or Unicode codepoints depends on if the [`u`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode) flag is set. - -```js -"😄😄".split(/(?:)/); // [ "\ud83d", "\ude04", "\ud83d", "\ude04" ] -"😄😄".split(/(?:)/u); // [ "😄", "😄" ] -``` - -If `separator` is a regular expression with capturing groups, then each time `separator` matches, the captured groups (including any `undefined` results) are spliced into the output array. This behavior is specified by the regexp's [`Symbol.split`](../../../globals/Symbol/split.mdx) method. - -If `separator` is an object with a [`Symbol.split`](../../../globals/Symbol/split.mdx) method, that method is called with the target string and `limit` as arguments, and `this` set to the object. Its return value becomes the return value of `split`. - -Any other value will be coerced to a string before being used as separator. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/startsWith.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/startsWith.mdx deleted file mode 100644 index fb1caddd95..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/startsWith.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.startsWith() - -The **`startsWith()`** method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate. - -## Syntax - -```js -startsWith(searchString) -startsWith(searchString, position) -``` - -### Parameters - -- `searchString` - - : The characters to be searched for at the start of this string. Cannot be a regex. -- `position` _**optional**_ - - : The start position at which `searchString` is expected to be found (the index of `searchString`'s first character). Defaults to `0`. - -### Return value - -**`true`** if the given characters are found at the beginning of the string; otherwise, **`false`**. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : If `searchString` [is a regex](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). - -## Description - -This method lets you determine whether or not a string begins with another string. This method is case-sensitive. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/substr.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/substr.mdx deleted file mode 100644 index 91205cc348..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/substr.mdx +++ /dev/null @@ -1,44 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substr() - -The **`substr()`** method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards. - -> **Note:** `substr()` is not part of the main ECMAScript specification — it's defined in [Annex B: Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers), which is normative optional for non-browser runtimes. Therefore, people are advised to use the standard [`String.prototype.substring()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring) and [`String.prototype.slice()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/slice) methods instead to make their code maximally cross-platform friendly. The [`String.prototype.substring()` page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/substring#the_difference_between_substring_and_substr) has some comparisons between the three methods. - - - -## Syntax - -```js -substr(start) -substr(start, length) -``` - -### Parameters - -- `start` - - : The index of the first character to include in the returned substring. -- `length` _**optional**_ - - : The number of characters to extract. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -A string's `substr()` method extracts `length` characters from the string, counting from the `start` index. - -- If `start >= str.length`, an empty string is returned. -- If `start < 0`, the index starts counting from the end of the string. More formally, in this case the substring starts at `max(start + str.length, 0)`. -- If `start` is omitted or [`undefined`](../../../globals/undefined.mdx), it's treated as `0`. -- If `length` is omitted or [`undefined`](../../../globals/undefined.mdx), or if `start + length >= str.length`, `substr()` extracts characters to the end of the string. -- If `length < 0`, an empty string is returned. -- For both `start` and `length`, [`NaN`](../../../globals/NaN.mdx) is treated as `0`. - -Although you are encouraged to avoid using `substr()`, there is no trivial way to migrate `substr()` to either `slice()` or `substring()` in legacy code without essentially writing a polyfill for `substr()`. For example, `str.substr(a, l)`, `str.slice(a, a + l)`, and `str.substring(a, a + l)` all have different results when `str = "01234", a = 1, l = -2` — `substr()` returns an empty string, `slice()` returns `"123"`, while `substring()` returns `"0"`. The actual refactoring path depends on the knowledge of the range of `a` and `l`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/substring.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/substring.mdx deleted file mode 100644 index 5efe922d4f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/substring.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.substring() - -The **`substring()`** method returns the part of the `string` from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. - -## Syntax - -```js -substring(indexStart) -substring(indexStart, indexEnd) -``` - -### Parameters - -- `indexStart` - - : The index of the first character to include in the returned substring. -- `indexEnd` _**optional**_ - - : The index of the first character to exclude from the returned substring. - -### Return value - -A new string containing the specified part of the given string. - -## Description - -`substring()` extracts characters from `indexStart` up to _but not including_ `indexEnd`. In particular: - -- If `indexEnd` is omitted, `substring()` extracts characters to the end of the string. -- If `indexStart` is equal to `indexEnd`, `substring()` returns an empty string. -- If `indexStart` is greater than `indexEnd`, then the effect of `substring()` is as if the two arguments were swapped; see example below. - -Any argument value that is less than `0` or greater than `str.length` is treated as if it were `0` and `str.length`, respectively. - -Any argument value that is [`NaN`](../../../globals/NaN.mdx) is treated as if it were `0`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toLocaleLowerCase.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toLocaleLowerCase.mdx deleted file mode 100644 index 80724caa4b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toLocaleLowerCase.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleLowerCase() - -The **`toLocaleLowerCase()`** method returns the calling string -value converted to lower case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleLowerCase() -toLocaleLowerCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to lower case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleLowerCase()` method returns the value of the string converted -to lower case according to any locale-specific case mappings. -`toLocaleLowerCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toLowerCase()`](../../../globals/String/prototype/toLowerCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toLocaleUpperCase.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toLocaleUpperCase.mdx deleted file mode 100644 index 2d46f8a0f7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toLocaleUpperCase.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLocaleUpperCase() - -The **`toLocaleUpperCase()`** method returns the calling string -value converted to upper case, according to any locale-specific case mappings. - -## Syntax - -```js -toLocaleUpperCase() -toLocaleUpperCase(locales) -``` - -### Parameters - -- `locales` _**optional**_ - - : A string with a BCP 47 language tag, or an array of such strings. Indicates the locale to be used to convert to upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see [Locale identification and negotiation](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation). - -### Return value - -A new string representing the calling string converted to upper case, according to any -locale-specific case mappings. - -### Exceptions - -- A [`RangeError`](../../../globals/RangeError/RangeError.mdx) ("invalid language tag: xx_yy") is thrown if a - `locale` argument isn't a valid language tag. -- A [`TypeError`](../../../globals/TypeError/TypeError.mdx) ("invalid element in locales argument") is thrown if an - array element isn't of type string. - -## Description - -The `toLocaleUpperCase()` method returns the value of the string converted -to upper case according to any locale-specific case mappings. -`toLocaleUpperCase()` does not affect the value of the string itself. In most -cases, this will produce the same result as [`String.prototype.toUpperCase()`](../../../globals/String/prototype/toUpperCase.mdx), but for some locales, such as Turkish, whose case mappings do not -follow the default case mappings in Unicode, there may be a different result. - -Also notice that conversion is not necessarily a 1:1 character mapping, as some -characters might result in two (or even more) characters when transformed to upper-case. -Therefore the length of the result string can differ from the input length. This also -implies that the conversion is not stable, so i.E. the following can return -`false`: -`x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()` diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toLowerCase.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toLowerCase.mdx deleted file mode 100644 index b2da1d62ad..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toLowerCase.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toLowerCase() - -The **`toLowerCase()`** method returns the calling string value -converted to lower case. - -## Syntax - -```js -toLowerCase() -``` - -### Return value - -A new string representing the calling string converted to lower case. - -## Description - -The `toLowerCase()` method returns the value of the string converted to -lower case. `toLowerCase()` does not affect the value of the string -`str` itself. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toString.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toString.mdx deleted file mode 100644 index 4f6c8f4555..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toString.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toString() - -The **`toString()`** method returns a string representing the specified string value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified string value. - -## Description - -The `String` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It has the exact same implementation as [`String.prototype.valueOf()`](../../../globals/String/prototype/valueOf.mdx). - -The `toString()` method requires its `this` value to be a `String` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to string values. - -Because `String` doesn't have a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `String` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, String _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — since they are already strings, no conversion is performed. - -```js -String.prototype.toString = () => "Overridden"; -console.log(`${"foo"}`); // "foo" -console.log(`${new String("foo")}`); // "Overridden" -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toUpperCase.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toUpperCase.mdx deleted file mode 100644 index 287fc9cc91..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/toUpperCase.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.toUpperCase() - -The **`toUpperCase()`** method returns the calling string value -converted to uppercase (the value will be converted to a string if it isn't one). - -## Syntax - -```js -toUpperCase() -``` - -### Return value - -A new string representing the calling string converted to upper case. - -### Exceptions - -- [`TypeError`](../../../globals/TypeError/TypeError.mdx) - - : When called on [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null) or [`undefined`](../../../globals/undefined.mdx), for example, - `String.prototype.toUpperCase.call(undefined)`. - -## Description - -The `toUpperCase()` method returns the value of the string converted to -uppercase. This method does not affect the value of the string itself since JavaScript -strings are immutable. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/trim.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/trim.mdx deleted file mode 100644 index 66b7636265..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/trim.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trim() - -The **`trim()`** method removes whitespace from both ends of a string and returns a new string, without modifying the original string. - -To return a new string with whitespace trimmed from just one end, use [`String.prototype.trimStart()`](../../../globals/String/prototype/trimStart.mdx) or [`String.prototype.trimEnd()`](../../../globals/String/prototype/trimEnd.mdx). - -## Syntax - -```js -trim() -``` - -### Return value - -A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If neither the beginning or end of `str` has any whitespace, a new string is still returned (essentially a copy of `str`). diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/trimEnd.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/trimEnd.mdx deleted file mode 100644 index b03666ab5f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/trimEnd.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimEnd() - -The **`trimEnd()`** method removes whitespace from the end of a string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method. - -## Syntax - -```js -trimEnd() - -trimRight() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the end of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with [`String.prototype.pedEnd()`](../../../globals/String/prototype/trim.mdx), when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` remains as an alias to `trimEnd`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimRight.name === "trimEnd"; -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/trimStart.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/trimStart.mdx deleted file mode 100644 index 83d01f6816..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/trimStart.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.trimStart() - -The **`trimStart()`** method removes whitespace from the beginning of a string and returns a new string, without modifying the original string. `trimLeft()` is an alias of this method. - -## Syntax - -```js -trimStart() - -trimLeft() -``` - -### Return value - -A new string representing `str` stripped of whitespace from its beginning (left side). Whitespace is defined as [white space](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#white_space) characters plus [line terminators](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#line_terminators). - -If the beginning of `str` has no whitespace, a new string is still returned (essentially a copy of `str`). - -### Aliasing - -After [`String.prototype.trim()`](../../../globals/String/prototype/trim.mdx) was standardized, engines also implemented the non-standard method `trimLeft`. However, for consistency with [`String.prototype.padEnd()`](../../../globals/String/prototype/padEnd.mdx), when the method got standardized, its name was chosen as `trimStart`. For web compatibility reasons, `trimLeft` remains as an alias to `trimStart`, and they refer to the exact same function object. In some engines this means: - -```js -String.prototype.trimLeft.name === "trimStart"; -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/prototype/valueOf.mdx deleted file mode 100644 index 3b7c236bb5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/prototype/valueOf.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a -`String` object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -A string representing the primitive value of a given `String` object. - -## Description - -The `valueOf()` method of `String` returns the primitive value -of a `String` object as a string data type. This value is equivalent to -[`String.prototype.toString()`](../../../globals/String/prototype/toString.mdx). - -This method is usually called internally by JavaScript and not explicitly in code. diff --git a/documentation/versioned_docs/version-3.9.0/globals/String/raw.mdx b/documentation/versioned_docs/version-3.9.0/globals/String/raw.mdx deleted file mode 100644 index 31bcda60c0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/String/raw.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# String.raw() - -The static **`String.raw()`** method is a tag function of [template literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). This is similar to the `r` prefix in Python, or the `@` prefix in C# for string literals. It's used to get the raw string form of template literals — that is, substitutions (e.g. `${foo}`) are processed, but escape sequences (e.g. `\n`) are not. - -## Syntax - -```js -String.raw(strings, ...substitutions) - -String.raw`templateString` -``` - -### Parameters - -- `strings` - - : Well-formed template literal array object, like `{ raw: ['foo', 'bar', 'baz'] }`. Should be an object with a `raw` property whose value is an array-like object of strings. -- `...substitutions` - - : Contains substitution values. -- `templateString` - - : A [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals), optionally with substitutions (`${...}`). - -### Return value - -The raw string form of a given template literal. - -### Exceptions - -- [`TypeError`](../../globals/TypeError/TypeError.mdx) - - : Thrown if the first argument doesn't have a `raw` property, or the `raw` property is `undefined` or `null`. - -## Description - -In most cases, `String.raw()` is used with template literals. The first syntax mentioned above is only rarely used, because the JavaScript engine will call this with proper arguments for you, (just like with other [tag functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals#tagged_templates)). - -`String.raw()` is the only built-in template literal tag. It has close semantics to an untagged literal since it concatenates all arguments and returns a string. You can even re-implement it with normal JavaScript code. - -> **Warning:** You should not use `String.raw` directly as an "identity" tag. See [Building an identity tag](#building_an_identity_tag) for how to implement this. - -If `String.raw()` is called with an object whose `raw` property doesn't have a `length` property or a non-positive `length`, it returns an empty string `""`. If `substitutions.length < strings.raw.length - 1` (i.e. there are not enough substitutions to fill the placeholders — which can't happen in a well-formed tagged template literal), the rest of the placeholders are filled with empty strings. diff --git a/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/SubtleCrypto.mdx b/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/SubtleCrypto.mdx deleted file mode 100644 index e6e0078789..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/SubtleCrypto.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SubtleCrypto - -The **`SubtleCrypto`** interface provides a number of low-level cryptographic functions. Access to the features of `SubtleCrypto` is obtained through the [`crypto.subtle`](../crypto/subtle.mdx) property. - -> **Warning:** This API provides a number of low-level cryptographic primitives. It's very easy to misuse them, and the pitfalls involved can be very subtle. -> -> Even assuming you use the basic cryptographic functions correctly, secure key management and overall security system design are extremely hard to get right, and are generally the domain of specialist security experts. -> -> Errors in security system design and implementation can make the security of the system completely ineffective. -> -> Please learn and experiment, but don't guarantee or imply the security of your work before an individual knowledgeable in this subject matter thoroughly reviews it. The [Crypto 101 Course](https://www.crypto101.io/) can be a great place to start learning about the design and implementation of secure systems. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/digest.mdx b/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/digest.mdx deleted file mode 100644 index 4a937ea702..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/digest.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# digest() - -The **`digest()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface generates a digest of the given data. A digest is a short -fixed-length value derived from some variable-length input. Cryptographic digests should -exhibit collision-resistance, meaning that it's hard to come up with two different -inputs that have the same digest value. - -It takes as its arguments an identifier for the digest algorithm to use and the data to -digest. It returns a [`Promise`](../../Promise/Promise.mdx) which will be fulfilled with the digest. - -## Syntax - -```js -digest(algorithm, data) -``` - -### Parameters - -- `algorithm` - - : This may be a string or an object with a single property `name` that is a string. The string names the hash function to use. Supported values are: - - `"MD5"` (but don't use this in cryptographic applications) - - `"SHA-1"` (but don't use this in cryptographic applications) - - `"SHA-256"` - - `"SHA-384"` - - `"SHA-512"`. -- `data` - - : An `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the data to be digested. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) that fulfills with an `ArrayBuffer` containing the digest. - -## Supported algorithms - -Digest algorithms, also known as cryptographic hash functions, -transform an arbitrarily large block of data into a fixed-size output, -usually much shorter than the input. They have a variety of applications in -cryptography. diff --git a/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/importKey.mdx b/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/importKey.mdx deleted file mode 100644 index 7253643753..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/importKey.mdx +++ /dev/null @@ -1,99 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# importKey() - -The **`importKey()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) -interface imports a key: that is, it takes as input a key in an external, portable -format and gives you a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object that you can use. - -The function accepts several import formats: see [Supported formats](#supported-formats) for details. - -## Syntax - -```js -importKey(format, keyData, algorithm, extractable, keyUsages) -``` - -### Parameters - -- `format` - - : A string describing the data format of the key to import. It can be one of the following: - - `raw`: [Raw](#raw) format. - - `jwk`: [JSON Web Key](#json_web_key) format. -- `keyData` - - : An `ArrayBuffer`, a TypedArray, a `DataView`, or a `JSONWebKey` object containing the key in - the given format. -- `algorithm` - - : An object defining the type of key to import and providing extra algorithm-specific parameters. - - For RSASSA-PKCS1-v1_5: - Pass an [`RsaHashedImportParams`](../../RsaHashedImportParams/RsaHashedImportParams.mdx) object. - - For HMAC: - Pass an [`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object. - - For ECDSA: - Pass an [`EcKeyImportParams`](../../EcKeyImportParams/EcKeyImportParams.mdx) object. -- `extractable` - - : A boolean value indicating whether it will be possible to export the key. -- `keyUsages` - - : An `Array` indicating what can be done with the key. Possible array values are: - - `encrypt`: The key may be used to encrypt messages. - - `decrypt`: The key may be used to decrypt messages. - - `sign`: The key may be used to sign messages. - - `verify`: The key may be used to verify signatures. - - `deriveKey`: The key may be used in deriving a new key. - - `deriveBits`: The key may be used in deriving bits. - - `wrapKey`: The key may be used to wrap a key. - - `unwrapKey`: The key may be used to unwrap a key. - -### Return value - -A [`Promise`](../../Promise/Promise.mdx) -that fulfills with the imported key as a [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object. - -### Exceptions - -The promise is rejected when one of the following exceptions is encountered: - -- `SyntaxError` - - : Raised when `keyUsages` is empty but the unwrapped key is of - type `secret` or `private`. -- `TypeError` - - : Raised when trying to use an invalid format or if the `keyData` - is not suited for that format. - -## Supported formats - -This API currently supports one key import/export format: JSON Web Key. - -### Raw - -You can use this format to import or export AES or HMAC secret keys, or Elliptic Curve -public keys. - -In this format the key is supplied as an `ArrayBuffer` containing the raw bytes for the key. - - -### JSON Web Key - -You can use JSON Web Key format to import or export RSA or Elliptic Curve public or -private keys, as well as AES and HMAC secret keys. - -JSON Web Key format is defined in [RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517). -It describes a way to represent public, private, and secret keys as JSON objects. - -A JSON Web Key looks something like this (this is an EC private key): - -```json -{ - "crv": "P-384", - "d": "wouCtU7Nw4E8_7n5C1-xBjB4xqSb_liZhYMsy8MGgxUny6Q8NCoH9xSiviwLFfK_", - "ext": true, - "key_ops": ["sign"], - "kty": "EC", - "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", - "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" -}; -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/sign.mdx b/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/sign.mdx deleted file mode 100644 index c7cdac8c62..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/sign.mdx +++ /dev/null @@ -1,60 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# sign() - -The **`sign()`** method of the [`SubtleCrypto`](../SubtleCrypto.mdx) interface generates a digital signature. - -It takes as its arguments a key to sign with, some algorithm-specific -parameters, and the data to sign. It returns a `Promise` which will be -fulfilled with the signature. - -You can use the corresponding [`verify()`](./verify.mdx) method to verify the signature. - -## Syntax - -```js -sign(algorithm, key, data) -``` - -### Parameters - -- `algorithm` - - : A string or object that specifies the signature algorithm to use and its parameters: - - To use [RSASSA-PKCS1-v1_5](#rsassa-pkcs1-v1_5), pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use [HMAC](#hmac), pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) object containing the key to be used for signing. - If `algorithm` identifies a public-key cryptosystem, this is the private key. -- `data` - - : An `ArrayBuffer`, a TypedArray or a `DataView` object containing the data to be signed. - -### Return value - -A `Promise` that fulfills with an `ArrayBuffer` containing the signature. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the signing key is not a key for the request signing algorithm or when - trying to use an algorithm that is either unknown or isn't suitable for signing. - -## Supported algorithms - -### RSASSA-PKCS1-v1_5 - -The RSASSA-PKCS1-v1_5 algorithm is specified in [RFC 3447](https://datatracker.ietf.org/doc/html/rfc3447). - -### HMAC - -The HMAC algorithm calculates and verifies hash-based message authentication codes according to the -[FIPS 198-1 standard](https://csrc.nist.gov/csrc/media/publications/fips/198/1/final/documents/fips-198-1_final.pdf). - -The digest algorithm to use is specified in the -[`HmacImportParams`](../../HmacImportParams/HmacImportParams.mdx) object -that you pass into [`SubtleCrypto.importKey()`](./importKey.mdx). diff --git a/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/verify.mdx b/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/verify.mdx deleted file mode 100644 index df9d338369..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/SubtleCrypto/prototype/verify.mdx +++ /dev/null @@ -1,52 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# verify() - -The **`verify()`** method verifies a digital signature. - -It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. -It returns a `Promise` which will be fulfilled with a boolean value indicating whether the signature is valid. - -## Syntax - -```js -verify(algorithm, key, signature, data) -``` - -### Parameters - -- `algorithm` - - : A string or object defining the algorithm to use, and for some algorithm choices, some extra parameters. - The values given for the extra parameters must match those passed into the corresponding [`sign()`](./sign.mdx) call. - - To use RSASSA-PKCS1-v1_5, pass the string `"RSASSA-PKCS1-v1_5"` or an object of the form `{ "name": "RSASSA-PKCS1-v1_5" }`. - - To use HMAC, pass the string `"HMAC"` or an object of the form `{ "name": "HMAC" }`. -- `key` - - : A [`CryptoKey`](../../CryptoKey/CryptoKey.mdx) containing the key that will be used to verify the signature. - It is the secret key for a symmetric algorithm and the public key for a public-key system. -- `signature` - - : A `ArrayBuffer` containing the signature to verify. -- `data` - - : A `ArrayBuffer` containing the data whose signature is to be verified. - -### Return value - -A `Promise` that fulfills with a -boolean value: `true` if the signature is valid, `false` -otherwise. - -### Exceptions - -The promise is rejected when the following exception is encountered: - -- `InvalidAccessError` - - : Raised when the encryption key is not a key for the requested verifying algorithm or - when trying to use an algorithm that is either unknown or isn't suitable for a verify - operation. - -## Supported algorithms - -The `verify()` method supports the same algorithms as the [`sign()`](./sign.mdx) method. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/Symbol.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/Symbol.mdx deleted file mode 100644 index ef0e307755..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/Symbol.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol() - -The `Symbol()` constructor returns a value of type **symbol**, -but is incomplete as a constructor because it does not support the syntax -"`new Symbol()`" and it is not intended to be subclassed. It may be used as -the value of an -[`extends`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Classes/extends) -clause of a `class` definition but a -[`super`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/super) -call to it will cause an exception. - -## Syntax - -```js -Symbol() -Symbol(description) -``` - -> **Note:** `Symbol()` can only be called without `new`. Attempting to construct it with `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `description` _**optional**_ - - : A string. A description of the symbol which can be used for debugging but not to - access the symbol itself. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/asyncIterator.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/asyncIterator.mdx deleted file mode 100644 index 6bca6d00a4..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/asyncIterator.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.asyncIterator - -The **`Symbol.asyncIterator`** well-known symbol specifies the default [async iterator](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) for an object. If this property is set on an object, it is an async iterable and can be used in a [`for await...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of) loop. - -## Value - -The well-known symbol `Symbol.asyncIterator`. - -## Description - -The `Symbol.asyncIterator` symbol is a builtin symbol that is used to access an object's `Symbol.asyncIterator` method. In order for an object to be async iterable, it must have a `Symbol.asyncIterator` key. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/for.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/for.mdx deleted file mode 100644 index f49189c499..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/for.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.for() - -The **`Symbol.for(key)`** method searches for existing symbols -in a runtime-wide symbol registry with the given key and returns it if found. Otherwise -a new symbol gets created in the global symbol registry with this key. - -## Syntax - -```js -Symbol.for(key) -``` - -### Parameters - -- `key` - - : String, required. The key for the symbol (and also used for the description of the - symbol). - -### Return value - -An existing symbol with the given key if found; otherwise, a new symbol is created and -returned. - -## Description - -In contrast to `Symbol()`, the `Symbol.for()` function creates a -symbol available in a [global symbol registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry) list. `Symbol.for()` does also -not necessarily create a new symbol on every call, but checks first if a symbol with the -given `key` is already present in the registry. In that case, that symbol is -returned. If no symbol with the given key is found, `Symbol.for()` will -create a new global symbol. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/hasInstance.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/hasInstance.mdx deleted file mode 100644 index 942d20b3bf..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/hasInstance.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.hasInstance - -The **`Symbol.hasInstance`** well-known symbol is used to determine if a constructor object recognizes an object as its instance. The `instanceof` operator's behavior can be customized by this symbol. - -## Value - -The well-known symbol `Symbol.hasInstance`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/isConcatSpreadable.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/isConcatSpreadable.mdx deleted file mode 100644 index a2103a7829..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/isConcatSpreadable.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.isConcatSpreadable - -The **`Symbol.isConcatSpreadable`** well-known symbol is used to configure if an object should be flattened to its array elements when using the [`Array.prototype.concat()`](../../globals/Array/prototype/concat.mdx) method. - -## Value - -The well-known symbol `Symbol.isConcatSpreadable`. - -## Description - -The `Symbol.isConcatSpreadable` symbol (`Symbol.isConcatSpreadable`) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: - -- For array objects, the default behavior is to spread (flatten) elements. `Symbol.isConcatSpreadable` can avoid flattening in these cases. -- For array-like objects, the default behavior is no spreading or flattening. `Symbol.isConcatSpreadable` can force flattening in these cases. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/iterator.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/iterator.mdx deleted file mode 100644 index c258aa95e9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/iterator.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.iterator - -The well-known **`Symbol.iterator`** symbol specifies the default iterator for an object. Used by [`for...of`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of). - -## Value - -The well-known symbol `Symbol.iterator`. - -## Description - -Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `Symbol.iterator` method is called with no arguments, and the returned **iterator** is used to obtain the values to be iterated. - -Some built-in types have a default iteration behavior, while other types (such as `Object`) do not. The built-in types with a `Symbol.iterator` method are: - -- [`Array.prototype[Symbol.iterator]()`](../../globals/Array/prototype/@@iterator.mdx) -- [`String.prototype[Symbol.iterator]()`](../../globals/String/prototype/@@iterator.mdx) -- [`Map.prototype[Symbol.iterator]()`](../../globals/Map/prototype/@@iterator.mdx) -- [`Set.prototype[Symbol.iterator]()`](../../globals/Set/prototype/@@iterator.mdx) - -See also [Iteration protocols](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols) for more information. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/keyFor.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/keyFor.mdx deleted file mode 100644 index 34421f5616..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/keyFor.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.keyFor() - -The **`Symbol.keyFor(sym)`** method retrieves a shared symbol -key from the global symbol registry for the given symbol. - -## Syntax - -```js -Symbol.keyFor(sym) -``` - -### Parameters - -- `sym` - - : Symbol, required. The symbol to find a key for. - -### Return value - -A string representing the key for the given symbol if one is found on the [global registry](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry); otherwise, [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/match.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/match.mdx deleted file mode 100644 index db3d9393b8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/match.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.match - -The **`Symbol.match`** well-known symbol specifies the matching of a regular expression against a string. This function is called by the [`String.prototype.match()`](../../globals/String/prototype/match.mdx) method. - -For more information, see `RegExp.prototype[Symbol.match]()` and [`String.prototype.match()`](../../globals/String/prototype/match.mdx). - -## Value - -The well-known symbol `Symbolmatch`. - -## Description - -This function is also used to identify [if objects have the behavior of regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#special_handling_for_regexes). For example, the methods [`String.prototype.startsWith()`](../../globals/String/prototype/startsWith.mdx), [`String.prototype.endsWith()`](../../globals/String/prototype/endsWith.mdx) and [`String.prototype.includes()`](../../globals/String/prototype/includes.mdx), check if their first argument is a regular expression and will throw a [`TypeError`](../../globals/TypeError/TypeError.mdx) if they are. Now, if the `match` symbol is set to `false` (or a [Falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value except `undefined`), it indicates that the object is not intended to be used as a regular expression object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/matchAll.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/matchAll.mdx deleted file mode 100644 index e9154b7598..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/matchAll.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.matchAll - -The **`Symbol.matchAll`** well-known symbol specifies the method that returns an iterator, that yields matches of the regular expression against a string. This function is called by the [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx) method. - -For more information, see `RegExp.prototype[Symbol.matchAll]()` and [`String.prototype.matchAll()`](../../globals/String/prototype/matchAll.mdx). - -## Value - -The well-known symbol `Symbol.matchAll`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/@@toPrimitive.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/@@toPrimitive.mdx deleted file mode 100644 index 6379a93f50..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/@@toPrimitive.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype[Symbol.toPrimitive] - -The **`[Symbol.toPrimitive]()`** method converts a Symbol object to -a primitive value. - -## Syntax - -```js -Symbol()[Symbol.toPrimitive](hint) -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive -value of a Symbol object as a Symbol data type. The `hint` -argument is not used. - -JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a -primitive value. You rarely need to invoke the `[Symbol.toPrimitive]()` method -yourself; JavaScript automatically invokes it when encountering an object where a -primitive value is expected. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/description.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/description.mdx deleted file mode 100644 index 16b667961a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/description.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.description - -The read-only **`description`** property is a string returning the optional description of `Symbol` objects. - -## Description - -`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toString()` as it does not contain the enclosing `"Symbol()"` string. See the examples. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/toString.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/toString.mdx deleted file mode 100644 index 8f962af898..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/toString.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.toString() - -The **`toString()`** method returns a string representing the specified symbol value. - -## Syntax - -```js -toString() -``` - -### Return value - -A string representing the specified symbol value. - -## Description - -The `Symbol` object overrides the `toString` method of `Object`; it does not inherit -[`Object.prototype.toString()`](../../../globals/Object/prototype/toString.mdx). For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symbol's [`Symbol.prototype.description`](../../../globals/Symbol/prototype/description.mdx). - -The `toString()` method requires its `this` value to be a `Symbol` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to symbol values. - -Because `Symbol` has a [`[Symbol.toPrimitive]()`](../../../globals/Symbol/toPrimitive.mdx) method, that method always takes priority over `toString()` when a `Symbol` object is [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). However, because `Symbol.prototype[Symbol.toPrimitive]()` returns a symbol primitive, and symbol primitives throw a [`TypeError`](../../../globals/TypeError/TypeError.mdx) when implicitly converted to a string, the `toString()` method is never implicitly called by the language. To stringify a symbol, you must explicitly call its `toString()` method or use the [`String()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/String#using_string_to_stringify_a_symbol) function. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/valueOf.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/valueOf.mdx deleted file mode 100644 index 354ed3c372..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/prototype/valueOf.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.prototype.valueOf() - -The **`valueOf()`** method returns the primitive value of a Symbol object. - -## Syntax - -```js -valueOf() -``` - -### Return value - -The primitive value of the specified `Symbol` object. - -## Description - -The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. - -JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScript automatically invokes it when encountering an object where a primitive value is expected. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/replace.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/replace.mdx deleted file mode 100644 index 22fa51e81f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/replace.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.replace - -The **`Symbol.replace`** well-known symbol specifies the method that replaces matched substrings of a string. This function is called by the [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx) method. - -For more information, see `RegExp.prototype[Symbol.replace]()` and [`String.prototype.replace()`](../../globals/String/prototype/replace.mdx). - -## Value - -The well-known symbol `Symbol.replace`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/search.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/search.mdx deleted file mode 100644 index 0119b34a5d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/search.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.search - -The **`Symbol.search`** well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the [`String.prototype.search()`](../../globals/String/prototype/search.mdx) method. - -For more information, see `RegExp.prototype[Symbol.search]()` and [`String.prototype.search()`](../../globals/String/prototype/search.mdx). - -## Value - -The well-known symbol `Symbol.search`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/species.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/species.mdx deleted file mode 100644 index 0a6137e0a0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/species.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.species - -The well-known symbol **`Symbol.species`** specifies a function-valued property that the constructor function uses to create derived objects. - -> **Warning:** The existence of `Symbol.species` allows execution of arbitrary code and may create security vulnerabilities. It also makes certain optimizations much harder. Engine implementers are [investigating whether to remove this feature](https://github.com/tc39/proposal-rm-builtin-subclassing). Avoid relying on it if possible. - -## Value - -The well-known symbol `Symbol.species`. - -## Description - -The `Symbol.species` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as [`Array.prototype.map()`](../../globals/Array/prototype/map.mdx). the `map()` method uses `instance.constructor[Symbol.species]` to get the constructor for constructing the new array. - -All built-in implementations of `Symbol.species` return the `this` value, which is the current instance's constructor. This allows copying methods to create instances of derived classes rather than the base class — for example, `map()` will return an array of the same type as the original array. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/split.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/split.mdx deleted file mode 100644 index bbf0685e66..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/split.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.split - -The **`Symbol.split`** well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the [`String.prototype.split()`](../../globals/String/prototype/split.mdx) method. - -For more information, see `RegExp.prototype[Symbol.split]()` and [`String.prototype.split()`](../../globals/String/prototype/split.mdx). - -## Value - -The well-known symbol `Symbol.split`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/toPrimitive.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/toPrimitive.mdx deleted file mode 100644 index b8ffd96714..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/toPrimitive.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toPrimitive - -The **`Symbol.toPrimitive`** well-known symbol specifies a method that accepts a preferred type and returns a primitive representation of an object. It is called in priority by all [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) algorithms. - -## Value - -The well-known symbol `Symbol.toPrimitive`. - -## Description - -With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `hint` argument can be one of `"number"`, `"string"`, and `"default"`. - -The `"number"` hint is used by [numeric coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#numeric_coercion) algorithms. The `"string"` hint is used by the [string coercion](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) algorithm. The `"default"` hint is used by the [primitive coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#primitive_coercion) algorithm. The `hint` only acts as a weak signal of preference, and the implementation is free to ignore it (as [`Symbol.prototype[Symbol.toPrimitive]()`](../../globals/Symbol/prototype/@@toPrimitive.mdx) does). The language does not enforce alignment between the `hint` and the result type, although `[Symbol.toPrimitive]()` must return a primitive, or a [`TypeError`](../../globals/TypeError/TypeError.mdx) is thrown. - -Objects without the `Symbol.toPrimitive` property are converted to primitives by calling the `valueOf()` and `toString()` methods in different orders, which is explained in more detail in the [type coercion](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#type_coercion) section. `Symbol.toPrimitive` allows full control over the primitive conversion process. For example, `Symbol.prototype.toString()` won't be called, and `Symbol` objects must always be explicitly converted to strings through [`String()`](../../globals/String/String.mdx). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/toStringTag.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/toStringTag.mdx deleted file mode 100644 index 98a1fc06bb..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/toStringTag.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.toStringTag - -The **`Symbol.toStringTag`** well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the [`Object.prototype.toString()`](../../globals/Object/prototype/toString.mdx) method. - -## Value - -The well-known symbol `Symbol.toStringTag`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Symbol/unscopables.mdx b/documentation/versioned_docs/version-3.9.0/globals/Symbol/unscopables.mdx deleted file mode 100644 index bb6b17c726..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Symbol/unscopables.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Symbol.unscopables - -The **`Symbol.unscopables`** well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings of the associated object. - -## Value - -The well-known symbol `@@unscopables`. - -## Description - -The `@@unscopables` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in [`with`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/with) environment bindings. Note that when using [strict mode](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Strict_mode), `with` statements are not available, and this symbol is likely not needed. - -Setting a property of the `@@unscopables` object to `true` (or any [truthy](https://developer.mozilla.org/docs/Glossary/Truthy) value) will make the corresponding property of the `with` scope object _unscopable_ and therefore won't be introduced to the `with` body scope. Setting a property to `false` (or any [falsy](https://developer.mozilla.org/docs/Glossary/Falsy) value) will make it _scopable_ and thus appear as lexical scope variables. - -When deciding whether `x` is unscopable, the entire prototype chain of the `@@unscopables` property is looked up for a property called `x`. This means if you declared `@@unscopables` as a plain object, `Object.prototype` properties like [`toString`](../../globals/Object/prototype/toString.mdx) would become unscopable as well, which may cause backward incompatibility for legacy code assuming those properties are normally scoped (see [an example below](#avoid_using_a_non-null-prototype_object_as_unscopables)). You are advised to make your custom `@@unscopables` property have `null` as its prototype, like [`Array.prototype[Symbol.unscopables]`](../../globals/Array/prototype/@@unscopables.mdx) does. diff --git a/documentation/versioned_docs/version-3.9.0/globals/SyntaxError/SyntaxError.mdx b/documentation/versioned_docs/version-3.9.0/globals/SyntaxError/SyntaxError.mdx deleted file mode 100644 index 594cd84d28..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/SyntaxError/SyntaxError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# SyntaxError - -The **`SyntaxError`** constructor creates a new error object -that represents an error when trying to interpret syntactically invalid code. - -## Syntax - -```js -new SyntaxError() -new SyntaxError(message) -new SyntaxError(message, options) -new SyntaxError(message, fileName) -new SyntaxError(message, fileName, lineNumber) - -SyntaxError() -SyntaxError(message) -SyntaxError(message, options) -SyntaxError(message, fileName) -SyntaxError(message, fileName, lineNumber) -``` - -> **Note:** `SyntaxError()` can be called with or without `new`. Both create a new `SyntaxError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/TextDecoder.mdx b/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/TextDecoder.mdx deleted file mode 100644 index 99822e5165..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/TextDecoder.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder() - -The **`TextDecoder()`** constructor returns a newly created `TextDecoder` object for the encoding specified in parameter. - -## Syntax - -```js -new TextDecoder() -new TextDecoder(label) -new TextDecoder(label, options) -``` - -### Parameters - -- `label` _**optional**_ - - : A string, defaulting to `"utf-8"`. -- `options` _**optional**_ - - - : An object with the property: - - - `fatal` - - : A boolean value indicating if the `TextDecoder.decode()` method must throw a `TypeError` when decoding invalid data. - It defaults to `false`, which means that the decoder will substitute malformed data with a replacement character. - - - `ignoreBOM` - - : A boolean value indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - It defaults to `false`. - -### Exceptions - -- `RangeError` - - : Thrown if the value of `label` is unknown, or is one of the values leading to a `'replacement'` decoding algorithm (`"iso-2022-cn"` or `"iso-2022-cn-ext"`). diff --git a/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/decode.mdx b/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/decode.mdx deleted file mode 100644 index 28331ec66b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/decode.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.decode() - -The **`TextDecoder.decode()`** method returns a string containing text decoded from the buffer passed as a parameter. - -The decoding method is defined in the current `TextDecoder` object. -This includes the expected encoding of the data, and how decoding errors are handled. - -## Syntax - -```js -decode() -decode(buffer) -decode(buffer, options) -``` - -### Parameters - -- `buffer` _**optional**_ - - : Is an `ArrayBuffer`, a `TypedArray` or a `DataView` object containing the encoded text to decode. -- `options` _**optional**_ - - - : An object with the property: - - - `stream` - - : A boolean flag indicating that additional data will follow in subsequent calls to `decode()`. - Set to `true` if processing the data in chunks, and `false` for the final chunk or if the data is not chunked. - It defaults to `false`. - -### Exceptions - -- `TypeError` - - : Thrown if there is a decoding error when the property `TextDecoder.fatal` is `true`. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/encoding.mdx deleted file mode 100644 index 99a52dce19..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/encoding.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.encoding - -The **`TextDecoder.encoding`** read-only property returns a string containing the name of the decoding algorithm used by the specific decoder object. - -The encoding is set by the constructor `label` parameter, and defaults to `utf-8`. - -## Value - -A lower-cased ASCII string, which can be one of the following values: - -- The recommended encoding for the Web: `'utf-8'`. -- The legacy single-byte encodings: - ['ibm866'](https://en.wikipedia.org/wiki/Code_page_866), - ['iso-8859-2'](https://en.wikipedia.org/wiki/ISO/IEC_8859-2), - ['iso-8859-3'](https://en.wikipedia.org/wiki/ISO/IEC_8859-3), - ['iso-8859-4'](https://en.wikipedia.org/wiki/ISO/IEC_8859-4), - ['iso-8859-5'](https://en.wikipedia.org/wiki/ISO/IEC_8859-5), - ['iso-8859-6'](https://en.wikipedia.org/wiki/ISO/IEC_8859-6), - ['iso-8859-7'](https://en.wikipedia.org/wiki/ISO/IEC_8859-7), - ['iso-8859-8'](https://en.wikipedia.org/wiki/ISO/IEC_8859-8)'`, - ['iso-8859-8i'](https://en.wikipedia.org/wiki/ISO-8859-8-I), - ['iso-8859-10'](https://en.wikipedia.org/wiki/ISO/IEC_8859-10), - ['iso-8859-13'](https://en.wikipedia.org/wiki/ISO/IEC_8859-13), - ['iso-8859-14'](https://en.wikipedia.org/wiki/ISO/IEC_8859-14), - ['iso-8859-15'](https://en.wikipedia.org/wiki/ISO/IEC_8859-15), - ['iso-8859-16'](https://en.wikipedia.org/wiki/ISO/IEC_8859-16), - ['koi8-r'](https://en.wikipedia.org/wiki/KOI8-R), - ['koi8-u'](https://en.wikipedia.org/wiki/KOI8-U), - ['macintosh'](https://en.wikipedia.org/wiki/Mac_OS_Roman), - ['windows-874'](https://en.wikipedia.org/wiki/Windows-874), - ['windows-1250'](https://en.wikipedia.org/wiki/Windows-1250), - ['windows-1251'](https://en.wikipedia.org/wiki/Windows-1251), - ['windows-1252'](https://en.wikipedia.org/wiki/Windows-1252), - ['windows-1253'](https://en.wikipedia.org/wiki/Windows-1253), - ['windows-1254'](https://en.wikipedia.org/wiki/Windows-1254), - ['windows-1255'](https://en.wikipedia.org/wiki/Windows-1255), - ['windows-1256'](https://en.wikipedia.org/wiki/Windows-1256), - ['windows-1257'](https://en.wikipedia.org/wiki/Windows-1257), - ['windows-1258'](https://en.wikipedia.org/wiki/Windows-1258), or - ['x-mac-cyrillic'](https://en.wikipedia.org/wiki/Macintosh_Cyrillic_encoding). -- The legacy multi-byte Chinese (simplified) encodings: - ['gbk'](https://en.wikipedia.org/wiki/GBK), - ['gb18030'](https://en.wikipedia.org/wiki/GB_18030) -- The legacy multi-byte Chinese (traditional) encoding: - ['big5'](https://en.wikipedia.org/wiki/Big5). -- The legacy multi-byte Japanese encodings: - ['euc-jp'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP), - ['iso-2022-jp'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-JP), - ['shift-jis'](https://en.wikipedia.org/wiki/Shift_JIS). -- The legacy multi-byte Korean encodings: - ['euc-kr'](https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR) -- The legacy miscellaneous encodings: - ['utf-16be'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - ['utf-16le'](https://en.wikipedia.org/wiki/UTF-16#Byte_order_encoding_schemes), - `'x-user-defined'`. -- A special encoding, `'replacement'`. - This decodes empty input into empty output and any other arbitrary-length input into a single replacement character. - It is used to prevent attacks that mismatch encodings between the client and server. - The following encodings also map to the replacement encoding: `ISO-2022-CN`, `ISO-2022-CN-ext`, ['iso-2022-kr'](https://en.wikipedia.org/wiki/ISO/IEC_2022#ISO-2022-KR) and ['hz-gb-2312'](). diff --git a/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/fatal.mdx b/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/fatal.mdx deleted file mode 100644 index 5af4ed97ac..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/fatal.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.fatal - -The **`fatal`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the error mode is fatal. - -If the property is `true` then a decoder will throw a `TypeError` if it encounters malformed data while decoding. -If `false` the decoder will substitute the invalid data with the replacement character `U+FFFD` (�). -The value of the property is set in the `TextDecoder()` constructor. - -## Value - -A `boolean` which will return `true` if the error mode is set to `fatal`. -Otherwise it returns `false`, indicating that the error mode is "replacement". diff --git a/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/ignoreBOM.mdx b/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/ignoreBOM.mdx deleted file mode 100644 index 6cb1a57b51..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TextDecoder/prototype/ignoreBOM.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextDecoder.ignoreBOM - -The **`ignoreBOM`** read-only property of the `TextDecoder` interface is a `Boolean` indicating whether the [byte order mark](https://www.w3.org/International/questions/qa-byte-order-mark) is ignored. - -## Value - -`true` if the byte order mark is ignored; `false` otherwise. diff --git a/documentation/versioned_docs/version-3.9.0/globals/TextEncoder/TextEncoder.mdx b/documentation/versioned_docs/version-3.9.0/globals/TextEncoder/TextEncoder.mdx deleted file mode 100644 index 0dc8ea2ceb..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TextEncoder/TextEncoder.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder() - -The **`TextEncoder()`** constructor returns a newly created `TextEncoder` object that will generate a byte stream with UTF-8 encoding. - -## Syntax - -```js -new TextEncoder() -``` - -### Parameters - -None. diff --git a/documentation/versioned_docs/version-3.9.0/globals/TextEncoder/prototype/encode.mdx b/documentation/versioned_docs/version-3.9.0/globals/TextEncoder/prototype/encode.mdx deleted file mode 100644 index 8e737b1c48..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TextEncoder/prototype/encode.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encode() - -The **`TextEncoder.encode()`** method takes a string as input, and returns a `Uint8Array` containing the text given in parameters encoded with the specific method for that `TextEncoder` object. - -## Syntax - -```js -encode(string) -``` - -### Parameters - -- `string` - - : A string containing the text to encode. - -### Return value - -A `Uint8Array` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/TextEncoder/prototype/encoding.mdx b/documentation/versioned_docs/version-3.9.0/globals/TextEncoder/prototype/encoding.mdx deleted file mode 100644 index 1ea4f137fb..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TextEncoder/prototype/encoding.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TextEncoder.encoding - -The **`TextEncoder.encoding`** read-only property returns a string containing the name of the encoding algorithm used by the specific encoder. - -It can only have the following value `utf-8`. - -## Value - -A string with the value `utf-8`. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/TransformStream/TransformStream.mdx b/documentation/versioned_docs/version-3.9.0/globals/TransformStream/TransformStream.mdx deleted file mode 100644 index b4e2389c1e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TransformStream/TransformStream.mdx +++ /dev/null @@ -1,62 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream() - -The **`TransformStream()`** constructor creates a new `TransformStream` object which represents a pair of streams: a `WritableStream` representing the writable side, and a `ReadableStream` representing the readable side. - -## Syntax - -```js -new TransformStream() -new TransformStream(transformer) -new TransformStream(transformer, writableStrategy) -new TransformStream(transformer, writableStrategy, readableStrategy) -``` - -### Parameters - -- `transformer` _**optional**_ - - - : An object representing the `transformer`. If not supplied the resulting stream will be an **identity transform stream** which forwards all chunks written to its writable side to its readable side, without any changes. - - The transformer object can contain any of the following methods. In each method `controller` is an instance of `TransformStreamDefaultController`. - - - `start(controller)` - - : Called when the `TransformStream` is constructed. It is typically used to enqueue chunks using `TransformStreamDefaultController.enqueue()`. - - `transform(chunk, controller)` - - : Called when a chunk written to the writable side is ready to be transformed, and performs the work of the transformation stream. If no `transform()` method is supplied, the identity transform is used, and the chunk will be enqueued with no changes. - - `flush(controller)` - - : Called after all chunks written to the writable side have been successfully transformed, and the writable side is about to be closed. - -- `writableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -- `readableStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer. This defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk`. This indicates the size to - use for each chunk, in bytes. - -> **Note:** You could define your own custom -> `readableStrategy` or `writableStrategy`, or use an instance of -> `ByteLengthQueuingStrategy` or `CountQueuingStrategy` -> for the object values. diff --git a/documentation/versioned_docs/version-3.9.0/globals/TransformStream/prototype/readable.mdx b/documentation/versioned_docs/version-3.9.0/globals/TransformStream/prototype/readable.mdx deleted file mode 100644 index 75507cf0a9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TransformStream/prototype/readable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.readable - -The **`readable`** read-only property of the `TransformStream` interface returns the `ReadableStream` instance controlled by this `TransformStream`. - -## Value - -A `ReadableStream`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/TransformStream/prototype/writable.mdx b/documentation/versioned_docs/version-3.9.0/globals/TransformStream/prototype/writable.mdx deleted file mode 100644 index 5c477ff80e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TransformStream/prototype/writable.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStream.writable - -The **`writable`** read-only property of the `TransformStream` interface returns the `WritableStream` instance controlled by this `TransformStream`. - -## Value - -A `WritableStream`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx deleted file mode 100644 index 7755d93436..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/desiredSize.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.desiredSize - -The **`desiredSize`** read-only property of the `TransformStreamDefaultController` interface returns the desired size to fill the queue of the associated [`ReadableStream`](../../../globals/ReadableStream/ReadableStream.mdx). - -The internal queue of a `ReadableStream` contains chunks that have been enqueued, but not yet read. - -If the `desiredSize` is `0` then the queue is full. Therefore you can use this information to manually apply backpressure to manage the queue. - -## Value - -The desired size. diff --git a/documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx b/documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx deleted file mode 100644 index e79183d04a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/enqueue.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.enqueue() - -The **`enqueue()`** method of the `TransformStreamDefaultController` interface enqueues the given chunk in the readable side of the stream. - -## Syntax - -```js -enqueue(chunk) -``` - -### Parameters - -- `chunk` - - : The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream is not readable. - This might occur if the stream is errored via `controller.error()`, or when it is closed without its controller's `controller.close()` method ever being called. diff --git a/documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/error.mdx b/documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/error.mdx deleted file mode 100644 index e4ca976e05..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/error.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.error() - -The **`error()`** method of the `TransformStreamDefaultController` interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded. - -## Syntax - -```js -error(reason) -``` - -### Parameters - -- `reason` - - : A string containing the error message to be returned on any further interaction with the stream. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/terminate.mdx b/documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/terminate.mdx deleted file mode 100644 index c7388d0510..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TransformStreamDefaultController/prototype/terminate.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TransformStreamDefaultController.terminate() - -The **`terminate()`** method of the `TransformStreamDefaultController` interface closes the readable side and errors the writable side of the stream. - -## Syntax - -```js -terminate() -``` - -### Parameters - -None. - -### Return value - -None (`undefined`). diff --git a/documentation/versioned_docs/version-3.9.0/globals/TypeError/TypeError.mdx b/documentation/versioned_docs/version-3.9.0/globals/TypeError/TypeError.mdx deleted file mode 100644 index 2e5938b6d9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/TypeError/TypeError.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# TypeError - -The **`TypeError()`** constructor creates a new error when an -operation could not be performed, typically (but not exclusively) when a value is not of -the expected type. - -## Syntax - -```js -new TypeError() -new TypeError(message) -new TypeError(message, options) -new TypeError(message, fileName) -new TypeError(message, fileName, lineNumber) - -TypeError() -TypeError(message) -TypeError(message, options) -TypeError(message, fileName) -TypeError(message, fileName, lineNumber) -``` - -> **Note:** `TypeError()` can be called with or without `new`. Both create a new `TypeError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URIError/URIError.mdx b/documentation/versioned_docs/version-3.9.0/globals/URIError/URIError.mdx deleted file mode 100644 index 76de6e86b5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URIError/URIError.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URIError - -The **`URIError()`** constructor creates an error when a global -URI handling function was used in a wrong way. - -## Syntax - -```js -new URIError() -new URIError(message) -new URIError(message, options) -new URIError(message, fileName) -new URIError(message, fileName, lineNumber) - -URIError() -URIError(message) -URIError(message, options) -URIError(message, fileName) -URIError(message, fileName, lineNumber) -``` - -> **Note:** `URIError()` can be called with or without `new`. Both create a new `URIError` instance. - -### Parameters - -- `message` _**optional**_ - - : Human-readable description of the error. -- `options` _**optional**_ - - : An object that has the following properties: - - `cause` _**optional**_ - - : A property indicating the specific cause of the error. - When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/URL.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/URL.mdx deleted file mode 100644 index 65310cb974..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/URL.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL() - -The **`URL()`** constructor returns a newly created -`URL` object representing the URL defined by the parameters. - -If the given base URL or the resulting URL are not valid URLs, the JavaScript -`TypeError` exception is thrown. - -## Syntax - -```js -new URL(url) -new URL(url, base) -``` - -### Parameters - -- `url` - - : A string or any other object with a `toString()` method. - If `url` is a relative URL, `base` is - required, and will be used as the base URL. If `url` is an - absolute URL, a given `base` will be ignored. -- `base` _**optional**_ - - : A string representing the base URL to use in cases where - `url` is a relative URL. If not specified, it defaults to - `undefined`. - -> **Note:** The `url` and `base` arguments will -> each be stringified from whatever value you pass, just like with other Web APIs -> that accept a string. In particular, you can use an existing -> `URL` object for either argument, and it will stringify to the -> object's `URL.href", "href` property. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/hash.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/hash.mdx deleted file mode 100644 index ae01074851..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/hash.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hash - -The **`hash`** property of the -`URL` interface is a string containing a -`'#'` followed by the fragment identifier of the URL. - -The fragment is not percent-decoded. If the URL does not -have a fragment identifier, this property contains an empty string — `""`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/host.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/host.mdx deleted file mode 100644 index f225f0e211..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/host.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.host - -The **`host`** property of the `URL` interface is -a string containing the host, that is the `URL.hostname`, and then, if the `port` of the URL is nonempty, a -`':'`, followed by the `port` of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/hostname.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/hostname.mdx deleted file mode 100644 index a545380985..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/hostname.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.hostname - -The **`hostname`** property of the `URL` interface -is a string containing the domain name of the URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/href.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/href.mdx deleted file mode 100644 index e144589ff8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/href.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.href - -The **`href`** property of the `URL` interface is -a string containing the whole URL. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/origin.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/origin.mdx deleted file mode 100644 index bf4f56890f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/origin.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.origin - -The **`origin`** read-only property of -the `URL` interface returns a string containing the -Unicode serialization of the origin of the represented URL. - -The exact structure -varies depending on the type of URL: - -- For `http` or `https` URLs, the scheme followed by - `'://'`, followed by the domain, followed by `':'`, followed by - the port (the default port, `80` and `443` respectively, if - explicitly specified). -- For `file:` URLs, the value is browser dependent. -- for `blob:` URLs, the origin of the URL following `blob:` will - be used. For example, `"blob:https://mozilla.org"` will be returned as - `"https://mozilla.org".` - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/password.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/password.mdx deleted file mode 100644 index 935cf48293..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/password.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.password - -The **`password`** property of the `URL` interface -is a string containing the password specified before the domain name. - -If it is set without first setting the `URL.username` property, it silently fails. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/pathname.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/pathname.mdx deleted file mode 100644 index 3124a84028..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/pathname.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.pathname - -The **`pathname`** property of the `URL` interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a `/` character. If the URL has no path segments, the value of its `pathname` property will be the empty string. - -URLs such as `https` and `http` URLs that have [hierarchical schemes](https://www.rfc-editor.org/rfc/rfc3986#section-1.2.3) (which the URL standard calls "[special schemes](https://url.spec.whatwg.org/#special-scheme)") always have at least one (invisible) path segment: the empty string. Thus the `pathname` value for such "special scheme" URLs can never be the empty string, but will instead always have a least one `/` character. - -For example, the URL `https://developer.mozilla.org` has just one path segment: the empty string, so its `pathname` value is constructed by prefixing a `/` character to the empty string. - -Some systems define the term _slug_ to mean the final segment of a non-empty path if it identifies a page in human-readable keywords. For example, the URL `https://example.org/articles/this-that-other-outre-collection` has `this-that-other-outre-collection` as its slug. - -Some systems use the `;` and `=` characters to delimit parameters and parameter values applicable to a path segment. For example, with the URL `https://example.org/users;id=42/tasks;state=open?sort=modified`, a system might extract and use the path segment parameters `id=42` and `state=open` from the path segments `users;id=42` and `tasks;state=open`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/port.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/port.mdx deleted file mode 100644 index 8cea5bef05..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/port.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.port - -The **`port`** property of the `URL` interface is -a string containing the port number of the URL. - -> **Note:** If an input string passed to the `URL()` constructor doesn't contain an explicit port number (e.g., `https://localhost`) or contains a port number that's the default port number corresponding to the protocol part of the input string (e.g., `https://localhost:443`), then in the `URL` object the constructor returns, the value of the port property will be the empty string: `''`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/protocol.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/protocol.mdx deleted file mode 100644 index 71a10df689..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/protocol.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.protocol - -The **`protocol`** property of the `URL` interface -is a string representing the protocol scheme of the URL, including the -final `':'`. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/search.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/search.mdx deleted file mode 100644 index 2461187aa7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/search.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.search - -The **`search`** property of the `URL` interface -is a search string, also called a _query string_, that is a -string containing a `'?'` followed by the parameters of the -URL. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/searchParams.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/searchParams.mdx deleted file mode 100644 index 0aea9464d8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/searchParams.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.searchParams - -The **`searchParams`** readonly property of the -`URL` interface returns a `URLSearchParams` object allowing -access to the `GET` decoded query arguments contained in the URL. - -## Value - -A `URLSearchParams` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/toJSON.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/toJSON.mdx deleted file mode 100644 index 62d7c77dff..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/toJSON.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toJSON() - -The **`toJSON()`** method of the `URL` interface -returns a string containing a serialized version of the URL, -although in practice it seems to have the same effect as -`URL.toString()`. - -## Syntax - -```js -toJSON() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/toString.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/toString.mdx deleted file mode 100644 index 66dd311fe9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/toString.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.toString() - -The **`URL.toString()`** method returns a -string containing the whole URL. It is effectively a read-only version -of `URL.prototype.href`. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/username.mdx b/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/username.mdx deleted file mode 100644 index b82ef26f34..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URL/prototype/username.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URL.username - -The **`username`** property of the `URL` interface -is a string containing the username specified before the domain name. - - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/URLSearchParams.mdx b/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/URLSearchParams.mdx deleted file mode 100644 index ab06d0e591..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/URLSearchParams.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams() - -The **`URLSearchParams()`** constructor creates and returns a -new `URLSearchParams` object. - - - -## Syntax - -```js -new URLSearchParams() -new URLSearchParams(options) -``` - -### Parameters - -- `options` _**optional**_ - - : One of: - - A string, which will be parsed from `application/x-www-form-urlencoded` format. A leading `'?'` character is ignored. - - A literal sequence of name-value string pairs, or any object with an iterator that produces a sequence of string pairs. - - A record of string keys and string values. Note that nesting is not supported. - -### Return value - -A `URLSearchParams` object instance. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/append.mdx b/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/append.mdx deleted file mode 100644 index 6d52f23874..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/append.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.append() - -The **`append()`** method of the `URLSearchParams` -interface appends a specified key/value pair as a new search parameter. - -As shown in the example below, if the same key is appended multiple times it will -appear in the parameter string multiple times for each value. - -## Syntax - -```js -append(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to append. -- `value` - - : The value of the parameter to append. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/delete.mdx b/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/delete.mdx deleted file mode 100644 index 4fa59438e0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/delete.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.delete() - -The **`delete()`** method of the `URLSearchParams` -interface deletes the given search parameter and all its associated values, from the -list of all search parameters. - -## Syntax - -```js -delete(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to be deleted. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/entries.mdx b/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/entries.mdx deleted file mode 100644 index 4425aa327d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/entries.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.entries() - -The **`entries()`** method of the -`URLSearchParams` interface returns an -iterator allowing iteration through all key/value -pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are -string objects. - -## Syntax - -```js -entries() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/forEach.mdx b/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/forEach.mdx deleted file mode 100644 index 1ba524a1dd..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/forEach.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.forEach() - -The **`forEach()`** method of the -`URLSearchParams` interface allows iteration through all values contained -in this object via a callback function. - -## Syntax - -```js -forEach(callback) -forEach(callback, thisArg) -``` - -### Parameters - -- `callback` - - - : Function to execute on each element, which is passed the following arguments: - - - `value` - - : The value of the current entry being processed in the `URLSearchParams` object. - - `key` - - : The key of the current entry being processed in the `URLSearchParams` object. - - `searchParams` - - : The `URLSearchParams` object the `forEach()` was called upon. - -- `thisArg` _**optional**_ - - : Value to use as `this` when executing `callback`. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/get.mdx b/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/get.mdx deleted file mode 100644 index d1da879a4b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.get() - -The **`get()`** method of the `URLSearchParams` -interface returns the first value associated to the given search parameter. - -## Syntax - -```js -get(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to return. - -### Return value - -A string if the given search parameter is found; otherwise, -**`null`**. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/has.mdx b/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/has.mdx deleted file mode 100644 index 84154434d4..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/has.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.has() - -The **`has()`** method of the `URLSearchParams` -interface returns a boolean value that indicates whether a parameter with the -specified name exists. - -## Syntax - -```js -has(name) -``` - -### Parameters - -- `name` - - : The name of the parameter to find. - -### Return value - -A boolean value. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/keys.mdx b/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/keys.mdx deleted file mode 100644 index 6d46f94046..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/keys.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.keys() - -The **`keys()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all keys contained in this object. The keys are string -objects. - -## Syntax - -```js -keys() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/set.mdx b/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/set.mdx deleted file mode 100644 index c89d24dab7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.set() - -The **`set()`** method of the `URLSearchParams` -interface sets the value associated with a given search parameter to the given value. -If there were several matching values, this method deletes the others. If the search -parameter doesn't exist, this method creates it. - -## Syntax - -```js -set(name, value) -``` - -### Parameters - -- `name` - - : The name of the parameter to set. -- `value` - - : The value of the parameter to set. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/sort.mdx b/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/sort.mdx deleted file mode 100644 index de129a0a2b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/sort.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.sort() - -The **`URLSearchParams.sort()`** method sorts all key/value -pairs contained in this object in place and returns `undefined`. The sort -order is according to unicode code points of the keys. This method uses a stable sorting -algorithm (i.e. the relative order between key/value pairs with equal keys will be -preserved). - -## Syntax - -```js -sort() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/toString.mdx b/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/toString.mdx deleted file mode 100644 index 518747bedf..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/toString.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.toString() - -The **`toString()`** method of the -`URLSearchParams` interface returns a query string suitable for use in a -URL. - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -A string, without the question mark. (Returns an empty string if no -search parameters have been set.) diff --git a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/values.mdx b/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/values.mdx deleted file mode 100644 index 98667f2e14..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/URLSearchParams/prototype/values.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# URLSearchParams.values() - -The **`values()`** method of the `URLSearchParams` -interface returns an iterator allowing iteration -through all values contained in this object. The values are string -objects. - -## Syntax - -```js -values() -``` - -### Parameters - -None. - -### Return value - -Returns an iterator. diff --git a/documentation/versioned_docs/version-3.9.0/globals/Uint16Array/Uint16Array.mdx b/documentation/versioned_docs/version-3.9.0/globals/Uint16Array/Uint16Array.mdx deleted file mode 100644 index 9b72c25e24..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Uint16Array/Uint16Array.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint16Array - -The **`Uint16Array()`** typed array constructor creates an -array of 16-bit unsigned integers in the platform byte order. - -## Syntax - -```js -new Uint16Array() -new Uint16Array(length) -new Uint16Array(typedArray) -new Uint16Array(object) - -new Uint16Array(buffer) -new Uint16Array(buffer, byteOffset) -new Uint16Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint16Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Uint32Array/Uint32Array.mdx b/documentation/versioned_docs/version-3.9.0/globals/Uint32Array/Uint32Array.mdx deleted file mode 100644 index 8da57b15ea..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Uint32Array/Uint32Array.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint32Array - -The **`Uint32Array()`** typed array constructor creates an -array of 32-bit unsigned integers in the platform byte order. If control over byte order -is needed, use [`DataView`](../../globals/DataView/DataView.mdx) instead. The contents are initialized to -`0`. Once established, you can reference elements in the array using the -object's methods, or using standard array index syntax (that is, using bracket -notation). - -## Syntax - -```js -new Uint32Array() -new Uint32Array(length) -new Uint32Array(typedArray) -new Uint32Array(object) - -new Uint32Array(buffer) -new Uint32Array(buffer, byteOffset) -new Uint32Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint32Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Uint8Array/Uint8Array.mdx b/documentation/versioned_docs/version-3.9.0/globals/Uint8Array/Uint8Array.mdx deleted file mode 100644 index b1fc8fc2f0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Uint8Array/Uint8Array.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8Array - -The **`Uint8Array()`** constructor creates a typed array of -8-bit unsigned integers. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8Array() -new Uint8Array(length) -new Uint8Array(typedArray) -new Uint8Array(object) - -new Uint8Array(buffer) -new Uint8Array(buffer, byteOffset) -new Uint8Array(buffer, byteOffset, length) -``` - -> **Note:** `Uint8Array()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.9.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx b/documentation/versioned_docs/version-3.9.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx deleted file mode 100644 index 42f4a34ee3..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/Uint8ClampedArray/Uint8ClampedArray.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Uint8ClampedArray - -The **`Uint8ClampedArray()`** constructor creates a typed array -of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the -range of \[0,255], 0 or 255 will be set instead; if you specify a non-integer, the -nearest integer will be set. The contents are initialized to `0`. Once -established, you can reference elements in the array using the object's methods, or -using standard array index syntax (that is, using bracket notation). - -## Syntax - -```js -new Uint8ClampedArray() -new Uint8ClampedArray(length) -new Uint8ClampedArray(typedArray) -new Uint8ClampedArray(object) - -new Uint8ClampedArray(buffer) -new Uint8ClampedArray(buffer, byteOffset) -new Uint8ClampedArray(buffer, byteOffset, length) -``` - -> **Note:** `Uint8ClampedArray()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#parameters). - -### Exceptions - -See [`TypedArray`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#exceptions). diff --git a/documentation/versioned_docs/version-3.9.0/globals/WeakMap/WeakMap.mdx b/documentation/versioned_docs/version-3.9.0/globals/WeakMap/WeakMap.mdx deleted file mode 100644 index 62ee3c1a80..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WeakMap/WeakMap.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap - -The **`WeakMap()` constructor** creates a `WeakMap` object, optionally based on a provided `Array` or other iterable object. - -## Syntax - -```js -new WeakMap() -new WeakMap(iterable) -``` - -> **Note:** `WeakMap()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` - - : An `Array` or other object that implements the [iterable protocol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/delete.mdx b/documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/delete.mdx deleted file mode 100644 index 7f25198054..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.delete() - -The **`delete()`** method removes the specified element from a -`WeakMap` object. - -## Syntax - -```js -delete(key) -``` - -### Parameters - -- `key` - - : The key of the element to remove from the `WeakMap` object. - -### Return value - -`true` if an element in the `WeakMap` object has been removed -successfully. `false` if the key is not found in the `WeakMap` or -if the key is not an object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/get.mdx b/documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/get.mdx deleted file mode 100644 index 1bd9dd61bc..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/get.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.get() - -The **`get()`** method returns a specified element from a -`WeakMap` object. - -## Syntax - -```js -get(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to return from the `WeakMap` object. - -### Return value - -The element associated with the specified key in the `WeakMap` object. If -the key can't be found, [`undefined`](../../../globals/undefined.mdx) is returned. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/has.mdx b/documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/has.mdx deleted file mode 100644 index 1de22a4115..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/has.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.has() - -The **`has()`** method returns a boolean indicating whether an -element with the specified key exists in the `WeakMap` object or not. - -## Syntax - -```js -has(key) -``` - -### Parameters - -- `key` - - : Required. The key of the element to test for presence in the `WeakMap` - object. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified key exists in the - `WeakMap` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/set.mdx b/documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/set.mdx deleted file mode 100644 index d35c7fe04c..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WeakMap/prototype/set.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakMap.prototype.set - -The **`set()`** method adds a new element with a specified key -and value to a `WeakMap` object. - -## Syntax - -```js -set(key, value) -``` - -### Parameters - -- `key` - - : Required. Must be `object`. The key of the element to add to the - `WeakMap` object. -- `value` - - : Required. Any value. The value of the element to add to the `WeakMap` - object. - -### Return value - -The `WeakMap` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WeakRef/WeakRef.mdx b/documentation/versioned_docs/version-3.9.0/globals/WeakRef/WeakRef.mdx deleted file mode 100644 index 9c152730be..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WeakRef/WeakRef.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef - -The **`WeakRef`** constructor creates a `WeakRef` -object referring to a given target object. - -## Syntax - -```js -new WeakRef(targetObject) -``` - -> **Note:** `WeakRef()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `targetObject` - - : The target object the WeakRef should refer to (also called the _referent_). diff --git a/documentation/versioned_docs/version-3.9.0/globals/WeakRef/prototype/deref.mdx b/documentation/versioned_docs/version-3.9.0/globals/WeakRef/prototype/deref.mdx deleted file mode 100644 index beec242da4..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WeakRef/prototype/deref.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakRef.prototype.deref() - -The `deref` method returns the `WeakRef` instance's target -object, or `undefined` if the target object has been garbage-collected. - -## Syntax - -```js -deref() -``` - -### Return value - -The target object of the WeakRef, or `undefined` if the object has been -garbage-collected. - -## Description - -See the [Notes on WeakRefs](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakRef#notes_on_weakrefs) section of the `WeakRef` page for some important notes. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WeakSet/WeakSet.mdx b/documentation/versioned_docs/version-3.9.0/globals/WeakSet/WeakSet.mdx deleted file mode 100644 index dd94b29e32..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WeakSet/WeakSet.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet - -The **`WeakSet`** constructor lets you create -`WeakSet` objects that store weakly held _objects_ in a collection. - -## Syntax - -```js -new WeakSet() -new WeakSet(iterable) -``` - -> **Note:** `WeakSet()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx). - -### Parameters - -- `iterable` _**optional**_ - - : If an [iterable object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of) is passed, all of its elements will be added to the new - `WeakSet`. null is treated as undefined. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WeakSet/prototype/add.mdx b/documentation/versioned_docs/version-3.9.0/globals/WeakSet/prototype/add.mdx deleted file mode 100644 index 1f99fad414..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WeakSet/prototype/add.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.add - -The **`add()`** method appends a new object to the end of a -`WeakSet` object. - -## Syntax - -```js -add(value) -``` - -### Parameters - -- value - - : Required. The object to add to the `WeakSet` collection. - -### Return value - -The `WeakSet` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WeakSet/prototype/delete.mdx b/documentation/versioned_docs/version-3.9.0/globals/WeakSet/prototype/delete.mdx deleted file mode 100644 index aadcefdff1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WeakSet/prototype/delete.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.delete - -The **`delete()`** method removes the specified element from a -`WeakSet` object. - -## Syntax - -```js -delete(value) -``` - -### Parameters - -- `value` - - : Required. The object remove from the `WeakSet` object. - -### Return value - -`true` if an element in the `WeakSet` object has been removed -successfully. `false` if the `value` is not found in -the `WeakSet` or if the `value` is not an object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WeakSet/prototype/has.mdx b/documentation/versioned_docs/version-3.9.0/globals/WeakSet/prototype/has.mdx deleted file mode 100644 index eed54135cf..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WeakSet/prototype/has.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WeakSet.prototype.has - -The **`has()`** method returns a boolean indicating whether an -object exists in a `WeakSet` or not. - -## Syntax - -```js -has(value) -``` - -### Parameters - -- `value` - - : Required. The object to test for presence in the `WeakSet`. - -### Return value - -- Boolean - - : Returns `true` if an element with the specified value exists in the - `WeakSet` object; otherwise `false`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/WorkerLocation.mdx b/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/WorkerLocation.mdx deleted file mode 100644 index 27f59d23f3..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/WorkerLocation.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# WorkerLocation - -The **`WorkerLocation`** interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the [`location`](../../globals/location.mdx) property obtained by calling `globalThis.location`. - -## Instance properties - -- [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx) _**read-only**_ - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. -- [`WorkerLocation.protocol`](../../globals/WorkerLocation/protocol.mdx) _**read-only**_ - - : Returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. -- [`WorkerLocation.host`](../../globals/WorkerLocation/host.mdx) _**read-only**_ - - : Returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. -- [`WorkerLocation.hostname`](../../globals/WorkerLocation/hostname.mdx) _**read-only**_ - - : Returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. -- [`WorkerLocation.origin`](../../globals/WorkerLocation/origin.mdx) _**read-only**_ - - : Returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). -- [`WorkerLocation.port`](../../globals/WorkerLocation/port.mdx) _**read-only**_ - - : Returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. -- [`WorkerLocation.pathname`](../../globals/WorkerLocation/pathname.mdx) _**read-only**_ - - : Returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. -- [`WorkerLocation.search`](../../globals/WorkerLocation/search.mdx) _**read-only**_ - - : Returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. -- [`WorkerLocation.hash`](../../globals/WorkerLocation/hash.mdx) _**read-only**_ - - : Returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Instance methods - -- [`WorkerLocation.toString`](../../globals/WorkerLocation/toString.mdx) - - : Returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). diff --git a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/hash.mdx b/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/hash.mdx deleted file mode 100644 index cfbc6ade03..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/hash.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hash - -The **`hash`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hash`](../../globals/URL/prototype/hash.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/host.mdx b/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/host.mdx deleted file mode 100644 index eb32431f2b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/host.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.host - -The **`host`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`host`](../../globals/URL/prototype/host.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/hostname.mdx b/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/hostname.mdx deleted file mode 100644 index 3227b18a33..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/hostname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.hostname - -The **`hostname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`hostname`](../../globals/URL/prototype/hostname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/href.mdx b/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/href.mdx deleted file mode 100644 index 6b75a17df7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/href.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.href - -The **`href`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/origin.mdx b/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/origin.mdx deleted file mode 100644 index 6634e2fd72..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/origin.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.origin - -The **`origin`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the worker's [`origin`](../../globals/URL/prototype/origin.mdx). - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/pathname.mdx b/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/pathname.mdx deleted file mode 100644 index 0a4d1ef824..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/pathname.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.pathname - -The **`pathname`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`pathname`](../../globals/URL/prototype/pathname.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/port.mdx b/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/port.mdx deleted file mode 100644 index 8dfcbf979b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/port.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.port - -The **`port`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`port`](../../globals/URL/prototype/port.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/protocol.mdx b/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/protocol.mdx deleted file mode 100644 index af6d77d201..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/protocol.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.protocol - -The **`protocol`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`protocol`](../../globals/URL/prototype/protocol.mdx) part of the worker's location. - -## Value - -A string. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/search.mdx b/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/search.mdx deleted file mode 100644 index 9be7a3823e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/search.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.search - -The **`search`** property of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns the [`search`](../../globals/URL/prototype/search.mdx) part of the worker's location. - -## Value - -A string. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/toString.mdx b/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/toString.mdx deleted file mode 100644 index 321ea1e13d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WorkerLocation/toString.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WorkerLocation.toString() - -The **`toString()`** method of a [`WorkerLocation`](../../globals/WorkerLocation/WorkerLocation.mdx) object returns a string containing the serialized [`URL`](../../globals/URL/URL.mdx) for the worker's location. It is a synonym for [`WorkerLocation.href`](../../globals/WorkerLocation/href.mdx). - -## Syntax - -```js -toString() -``` - -### Parameters - -None. - -### Return value - -None [`undefined`](../../globals/undefined.mdx). diff --git a/documentation/versioned_docs/version-3.9.0/globals/WritableStream/WritableStream.mdx b/documentation/versioned_docs/version-3.9.0/globals/WritableStream/WritableStream.mdx deleted file mode 100644 index 15d08a05be..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WritableStream/WritableStream.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream() - -The **`WritableStream()`** constructor creates -a new `WritableStream` object instance. - -## Syntax - -```js -new WritableStream(underlyingSink) -new WritableStream(underlyingSink, queuingStrategy) -``` - -### Parameters - -- `underlyingSink` _**optional**_ - - - : An object containing methods and properties that define how the constructed stream - instance will behave. `underlyingSink` can contain the following: - - - `start(controller)` _**optional**_ - - : This is a method, called immediately when the object is constructed. The - contents of this method are defined by the developer, and should aim to get access - to the underlying sink. If this process is to be done asynchronously, it can - return a promise to signal success or failure. The `controller` - parameter passed to this method is a - `WritableStreamDefaultController`. This can be used by the developer - to control the stream during set up. - - `write(chunk, controller)` _**optional**_ - - : This method, also defined by the developer, will be called when a new chunk of - data (specified in the `chunk` parameter) is ready to be written to the - underlying sink. It can return a promise to signal success or failure of the write - operation. The `controller` parameter passed to this method is a - `WritableStreamDefaultController` that can be used by the developer - to control the stream as more chunks are submitted for writing. This method will - be called only after previous writes have succeeded, and never after the stream is - closed or aborted (see below). - - `close(controller)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it has finished writing chunks to the stream. The contents should do whatever - is necessary to finalize writes to the underlying sink, and release access to it. - If this process is asynchronous, it can return a promise to signal success or - failure. This method will be called only after all queued-up writes have - succeeded. The `controller` parameter passed to this method is a - `WritableStreamDefaultController`, which can be used to control the - stream at the end of writing. - - `abort(reason)` _**optional**_ - - : This method, also defined by the developer, will be called if the app signals - that it wishes to abruptly close the stream and put it in an errored state. It can - clean up any held resources, much like `close()`, but - `abort()` will be called even if writes are queued up — those chunks - will be thrown away. If this process is asynchronous, it can return a promise to - signal success or failure. The `reason` parameter contains a - string describing why the stream was aborted. - -- `queuingStrategy` _**optional**_ - - - : An object that optionally defines a queuing strategy for the stream. This takes two - parameters: - - - `highWaterMark` - - : A non-negative integer — this defines the total number of chunks that can be - contained in the internal queue before backpressure is applied. - - `size(chunk)` - - : A method containing a parameter `chunk` — this indicates the size to use for each chunk, in bytes. - - > **Note:** You could define your own custom - > `queuingStrategy`, or use an instance of - > `ByteLengthQueuingStrategy` or `CountQueuingStrategy` - > for this object value. If no `queuingStrategy` is supplied, the default - > used is the same as a `CountQueuingStrategy` with a high water mark of 1\. - -### Return value - -An instance of the `WritableStream` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WritableStream/prototype/abort.mdx b/documentation/versioned_docs/version-3.9.0/globals/WritableStream/prototype/abort.mdx deleted file mode 100644 index 3ab2deeca3..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WritableStream/prototype/abort.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.abort() - -The **`abort()`** method of the `WritableStream` interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded. - -## Syntax - -```js -abort(reason) -``` - -### Parameters - -- `reason` - - : A string providing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is locked. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WritableStream/prototype/getWriter.mdx b/documentation/versioned_docs/version-3.9.0/globals/WritableStream/prototype/getWriter.mdx deleted file mode 100644 index fe569e5aa9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WritableStream/prototype/getWriter.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.getWriter() - -The **`getWriter()`** method of the `WritableStream` interface returns a new instance of `WritableStreamDefaultWriter` and locks the stream to that instance. -While the stream is locked, no other writer can be acquired until this one is released. - -## Syntax - -```js -getWriter() -``` - -### Parameters - -None. - -### Return value - -A `WritableStreamDefaultWriter` object instance. - -### Exceptions - -- `TypeError` - - : The stream you are trying to create a writer for is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WritableStream/prototype/locked.mdx b/documentation/versioned_docs/version-3.9.0/globals/WritableStream/prototype/locked.mdx deleted file mode 100644 index e97ce8ced6..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WritableStream/prototype/locked.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStream.locked - -The **`locked`** read-only property of the `WritableStream` interface returns a boolean indicating whether the `WritableStream` is locked to a writer. - -## Value - -A boolean value indicating whether or not the writable stream is locked. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultController/error.mdx b/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultController/error.mdx deleted file mode 100644 index 5bbb0bc054..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultController/error.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultController.error() - -The **`error()`** method of the -`WritableStreamDefaultController` interface causes any future interactions -with the associated stream to error. - -This method is rarely used, since usually it suffices to return a rejected promise from -one of the underlying sink's methods. However, it can be useful for suddenly shutting -down a stream in response to an event outside the normal lifecycle of interactions with -the underlying sink. - -## Syntax - -```js -error(message) -``` - -### Parameters - -- `message` - - : A string representing the error you want future interactions to - fail with. - -### Return value - -None `undefined`. - -### Exceptions - -- `TypeError` - - : The stream you are trying to error is not a `WritableStream`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx b/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx deleted file mode 100644 index de0e693b20..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/WritableStreamDefaultWriter.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter() - -The **`WritableStreamDefaultWriter()`** -constructor creates a new `WritableStreamDefaultWriter` object instance. - -## Syntax - -```js -new WritableStreamDefaultWriter(stream) -``` - -### Parameters - -- `stream` - - : The `WritableStream` to be written to. - -### Return value - -An instance of the `WritableStreamDefaultWriter` object. - -### Exceptions - -- `TypeError` - - : The provided `stream` value is not a `WritableStream`, or it - is locked to another writer already. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx b/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx deleted file mode 100644 index bbc6a6ba6e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/abort.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.abort() - -The **`abort()`** method of the -`WritableStreamDefaultWriter` interface aborts the stream, signaling that -the producer can no longer successfully write to the stream and it is to be immediately -moved to an error state, with any queued writes discarded. - -If the writer is active, the `abort()` method behaves the same as that for -the associated stream (`WritableStream.abort()`). If not, it returns a -rejected promise. - -## Syntax - -```js -abort() -abort(reason) -``` - -### Parameters - -- `reason` _**optional**_ - - : A string representing a human-readable reason for the abort. - -### Return value - -A `Promise`, which fulfills with the value given in the `reason` -parameter. - -### Exceptions - -- `TypeError` - - : The stream you are trying to abort is not a `WritableStream`, or it is - locked. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/close.mdx b/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/close.mdx deleted file mode 100644 index 707d8659f8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/close.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.close() - -The **`close()`** method of the -`WritableStreamDefaultWriter` interface closes the associated writable -stream. - -The underlying sink will finish processing any previously-written chunks, before -invoking the close behavior. During this time any further attempts to write will fail -(without erroring the stream). - -## Syntax - -```js -close() -``` - -### Parameters - -None. - -### Return value - -A `Promise`, which fulfills with the `undefined` if all -remaining chunks were successfully written before the close, or rejects with an error if -a problem was encountered during the process. - -### Exceptions - -- `TypeError` - - : The stream you are trying to close is not a `WritableStream`. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx b/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx deleted file mode 100644 index 5ae8234655..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/closed.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.closed - -The **`closed`** read-only property of the -`WritableStreamDefaultWriter` interface returns a -`Promise` that fulfills if the stream becomes closed, or rejects if -the stream errors or the writer's lock is released. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx b/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx deleted file mode 100644 index 539980c527..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/desiredSize.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.desiredSize - -The **`desiredSize`** read-only property of the -`WritableStreamDefaultWriter` interface returns the desired size required -to fill the stream's internal queue. - -## Value - -An integer. Note that this can be negative if the queue is over-full. - -The value will be `null` if the stream cannot be successfully written to -(due to either being errored, or having an abort queued up), and zero if the stream is -closed. - -### Exceptions - -- `TypeError` - - : The writer's lock is released. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx b/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx deleted file mode 100644 index 4ed4a3303e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/ready.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.ready - -The **`ready`** read-only property of the -`WritableStreamDefaultWriter` interface returns a `Promise` -that resolves when the desired size of the stream's internal queue transitions from -non-positive to positive, signaling that it is no longer applying backpressure. - -## Value - -A `Promise`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx b/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx deleted file mode 100644 index 91bb4072d6..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/releaseLock.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.releaseLock() - -The **`releaseLock()`** method of the -`WritableStreamDefaultWriter` interface releases the writer's lock on the -corresponding stream. After the lock is released, the writer is no longer active. If the -associated stream is errored when the lock is released, the writer will appear errored -in the same way from now on; otherwise, the writer will appear closed. - -## Syntax - -```js -releaseLock() -``` - -### Parameters - -None. - -### Return value - -None `undefined`. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/write.mdx b/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/write.mdx deleted file mode 100644 index 9b9ae0b600..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/WritableStreamDefaultWriter/prototype/write.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# WritableStreamDefaultWriter.write() - -The **`write()`** method of the -`WritableStreamDefaultWriter` interface writes a passed chunk of data to a -`WritableStream` and its underlying sink, then returns a -`Promise` that resolves to indicate the success or failure of the write -operation. - -Note that what "success" means is up to the underlying sink; it might indicate that the -chunk has been accepted, and not necessarily that it is safely saved to its ultimate -destination. - -## Syntax - -```js -write(chunk) -``` - -### Parameters - -- `chunk` - - : A block of binary data to pass to the `WritableStream`. - -### Return value - -A `Promise`, which fulfills with the `undefined` upon a -successful write, or rejects if the write fails or stream becomes errored before the -writing process is initiated. - -### Exceptions - -- `TypeError` - - : The target stream is not a writable stream, or it does not have an owner. diff --git a/documentation/versioned_docs/version-3.9.0/globals/atob.mdx b/documentation/versioned_docs/version-3.9.0/globals/atob.mdx deleted file mode 100644 index 20183ac150..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/atob.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# atob() - -The **`atob()`** function decodes a -string of data which has been encoded using Base64 encoding. You can use -the `btoa()` method to encode and transmit -data which may otherwise cause communication problems, then transmit it and use the -`atob()` method to decode the data again. For example, you can encode, -transmit, and decode control characters such as ASCII values 0 through 31. - -For use with Unicode or UTF-8 strings, see the note on "Unicode strings" in the page -for `btoa()`. - -## Syntax - -```js -atob(encodedData) -``` - -### Parameters - -- `encodedData` - - : A binary string (i.e., a string in which each character in the string is treated as a byte of binary data) containing base64-encoded data. - -### Return value - -An ASCII string containing decoded data from `encodedData`. - -### Exceptions - -- `InvalidCharacterError` - - : Thrown if `encodedData` is not valid base64. diff --git a/documentation/versioned_docs/version-3.9.0/globals/btoa.mdx b/documentation/versioned_docs/version-3.9.0/globals/btoa.mdx deleted file mode 100644 index 1d33b868b2..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/btoa.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# btoa() - -The **`btoa()`** method creates a -Base64-encoded ASCII string from a _binary string_ (i.e., a -string in which each character in the string is treated as a byte -of binary data). - -You can use this method to encode data which may otherwise cause communication -problems, transmit it, then use the `atob()` method to decode the data again. For example, you can encode control -characters such as ASCII values 0 through 31. - -## Syntax - -```js -btoa(stringToEncode) -``` - -### Parameters - -- `stringToEncode` - - : The _binary string_ to encode. - -### Return value - -An ASCII string containing the Base64 representation of -`stringToEncode`. - -### Exceptions - -- `InvalidCharacterError` - - : The string contained a character that did not fit in a single byte. See "Unicode - strings" below for more detail. diff --git a/documentation/versioned_docs/version-3.9.0/globals/clearInterval.mdx b/documentation/versioned_docs/version-3.9.0/globals/clearInterval.mdx deleted file mode 100644 index cc8b1435ef..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/clearInterval.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearInterval() - -The global **`clearInterval()`** method cancels a timed, repeating action which -was previously established by a call to `setInterval()`. -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearInterval(intervalID) -``` - -### Parameters - -- `intervalID` - - : The identifier of the repeated action you want to cancel. This ID was returned by - the corresponding call to `setInterval()`. - -It's worth noting that the pool of IDs used by -`setInterval()` and -`setTimeout()` are shared, which -means you can technically use `clearInterval()` and -`clearTimeout()` interchangeably. -However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/clearTimeout.mdx b/documentation/versioned_docs/version-3.9.0/globals/clearTimeout.mdx deleted file mode 100644 index cbdcf0111a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/clearTimeout.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# clearTimeout() - -The global **`clearTimeout()`** method cancels a timeout previously established -by calling `setTimeout()`. - -If the parameter provided does not identify a previously established action, -this method does nothing. - -## Syntax - -```js -clearTimeout(timeoutID) -``` - -### Parameters - -- `timeoutID` - - : The identifier of the timeout you want to cancel. This ID was returned by the - corresponding call to `setTimeout()`. - -It's worth noting that the pool of IDs used by -`setTimeout()` and -`setInterval()` are shared, which -means you can technically use `clearTimeout()` and -`clearInterval()` -interchangeably. However, for clarity, you should avoid doing so. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/assert.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/assert.mdx deleted file mode 100644 index f92a213ed1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/assert.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.assert() - -The **`console.assert()`** method writes an error message to -the console if the assertion is false. If the assertion is true, nothing happens. - -## Syntax - -```js -assert(assertion, obj1) -assert(assertion, obj1, obj2) -assert(assertion, obj1, obj2, /* … ,*/ objN) - -assert(assertion, msg) -assert(assertion, msg, subst1) -assert(assertion, msg, subst1, /* … ,*/ substN) -``` - -### Parameters - -- `assertion` - - : Any boolean expression. If the assertion is false, the message is written to the - console. -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. -- `msg` - - : A JavaScript string containing zero or more substitution strings. -- `subst1` … `substN` - - : JavaScript objects with which to replace substitution strings within - `msg`. This parameter gives you additional control over the format of the - output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/clear.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/clear.mdx deleted file mode 100644 index 5d70de59d6..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/clear.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.clear() - -The **`console.clear()`** method clears the console if the console allows it. - -## Syntax - -```js -clear() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/count.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/count.mdx deleted file mode 100644 index ea8b92a0d4..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/count.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.count() - -The **`console.count()`** method logs the number of times that -this particular call to `count()` has been called. - - -## Syntax - -```js -count() -count(label) -``` - -### Parameters - -- `label` _optional_ - - : A string. If supplied, `count()` outputs the number of - times it has been called with that label. If omitted, `count()` behaves as - though it was called with the "default" label. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/countReset.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/countReset.mdx deleted file mode 100644 index ead4a0f04f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/countReset.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.countReset() - -The **`console.countReset()`** method resets counter used with `console.count()`. - -## Syntax - -```js -countReset() -countReset(label) -``` - -### Parameters - -- `label` __optional__ - - : A string. If supplied, `countReset()` resets the count for - that label to 0. If omitted, `countReset()` resets the default counter to - 0. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/debug.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/debug.mdx deleted file mode 100644 index 97eccec542..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/debug.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.debug() - -The **`console.debug()`** method outputs a message to the console at the "debug" log level. - -## Syntax - -```js -debug(obj1) -debug(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output to the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/dir.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/dir.mdx deleted file mode 100644 index 2b80543015..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/dir.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dir() - -The method **`console.dir()`** displays a list of the properties of -the specified JavaScript object. - -## Syntax - -```js -dir(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/dirxml.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/dirxml.mdx deleted file mode 100644 index 94632ecdb3..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/dirxml.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.dirxml() - -The **`console.dirxml()`** method displays the supplied object in the console. - -## Syntax - -```js -dirxml(object) -``` - -### Parameters - -- `object` - - : A JavaScript object whose properties should be output. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/error.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/error.mdx deleted file mode 100644 index 3b932b66e4..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/error.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.error() - -The **`console.error()`** method outputs an error message console. - -## Syntax - -```js -error(obj1) -error(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of - these objects are appended together in the order listed and output. - -### Return value - -None `undefined`. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/group.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/group.mdx deleted file mode 100644 index 941e5b6058..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/group.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.group() - -The **`console.group()`** method creates a new inline group in the console, until `console.groupEnd()` is called. - -## Syntax - -```js -group() -group(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/groupCollapsed.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/groupCollapsed.mdx deleted file mode 100644 index 9fde047f30..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/groupCollapsed.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupCollapsed() - -The **`console.groupCollapsed()`** method creates a new inline group in the Web Console. Unlike `console.group()`, -however, the new group is created collapsed. The user will need to use the disclosure -button next to it to expand it, revealing the entries created in the group. - -Call `console.groupEnd()` to back out to the parent group. - -## Syntax - -```js -groupCollapsed() -groupCollapsed(label) -``` - -### Parameters - -- `label` __optional__ - - : Label for the group. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/groupEnd.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/groupEnd.mdx deleted file mode 100644 index 7fc48a0ccd..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/groupEnd.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.groupEnd() - -The **`console.groupEnd()`** method exits the current inline group in the console. - -## Syntax - -```js -groupEnd() -``` - -### Parameters - -None. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/info.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/info.mdx deleted file mode 100644 index 5972f6ed55..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/info.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.info() - -The **`console.info()`** method outputs an informational message to the console. - -## Syntax - -```js -info(obj1) -info(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/log.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/log.mdx deleted file mode 100644 index 6b7d300dcf..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/log.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.log() - -The **`console.log()`** method outputs a message to the console. - -## Syntax - -```js -log(obj1) -log(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. Please be warned that if - you log objects in the latest versions of Chrome and Firefox what you get logged on - the console is a _reference to the object_, which is not necessarily the - 'value' of the object at the moment in time you call `console.log()`, but - it is the value of the object at the moment you open the console. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/time.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/time.mdx deleted file mode 100644 index 608ec95de7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/time.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.time() - -The **`console.time()`** method starts a timer you can use to track -how long an operation takes. You give each timer a unique name. When you call `console.timeEnd()` with the same name, the -browser will output the time, in milliseconds, that elapsed since the timer was started. - -## Syntax - -```js -time(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name to give the new timer. This will identify the timer; use the same name when - calling `console.timeEnd()` to stop the timer and get the time output to - the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/timeEnd.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/timeEnd.mdx deleted file mode 100644 index 313ee7e737..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/timeEnd.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeEnd() - -The **`console.timeEnd()`** stops a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeEnd(label) -``` - -### Parameters - -- `label` - - : A `string` representing the name of the timer to stop. Once stopped, the elapsed time is automatically - displayed in the console. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/timeLog.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/timeLog.mdx deleted file mode 100644 index 9b44ef3de8..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/timeLog.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.timeLog() - -The **`console.timeLog()`** method logs the current value of a timer that was previously started by calling `console.time()`. - -## Syntax - -```js -timeLog() -timeLog(label) -``` - -### Parameters - -- `label` __optional__ - - : The name of the timer to log to the console. If this is omitted the label "default" is used. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/trace.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/trace.mdx deleted file mode 100644 index a6d4ef33c6..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/trace.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# console.trace() - -The **`console.trace()`** method outputs a stack trace to the console. - -## Syntax - -```js -trace() -trace(object1, /* …, */ objectN) -``` - -### Parameters - -- `objects` __optional__ - - : Zero or more objects to be output to console along with the trace. These are - assembled and formatted the same way they would be if passed to the `console.log()` method. - -### Return value - -`undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/console/warn.mdx b/documentation/versioned_docs/version-3.9.0/globals/console/warn.mdx deleted file mode 100644 index 56b28205df..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/console/warn.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# console.warn() - -The **`console.warn()`** method outputs a warning message to the console. - -## Syntax - -```js -warn(obj1) -warn(obj1, /* …, */ objN) -``` - -### Parameters - -- `obj1` … `objN` - - : A list of JavaScript objects to output. The string representations of each of these - objects are appended together in the order listed and output. - -### Return value - -None `undefined`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/crypto/getRandomValues.mdx b/documentation/versioned_docs/version-3.9.0/globals/crypto/getRandomValues.mdx deleted file mode 100644 index 29427a24b0..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/crypto/getRandomValues.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.getRandomValues() - -The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values. -The array given as the parameter is filled with random numbers (random in its cryptographic meaning). - -## Syntax - -```js -getRandomValues(typedArray) -``` - -### Parameters - -- `typedArray` - - : An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`, - `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, - `Int32Array`, `Uint32Array`, `BigInt64Array`, - `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`). - All elements in the array will be overwritten with random numbers. - -### Return value - -The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers. -Note that `typedArray` is modified in-place, and no copy is made. - -### Exceptions - -- `QuotaExceededError` - - : Thrown if the `byteLength` of `typedArray` exceeds 65,536. diff --git a/documentation/versioned_docs/version-3.9.0/globals/crypto/randomUUID.mdx b/documentation/versioned_docs/version-3.9.0/globals/crypto/randomUUID.mdx deleted file mode 100644 index 8b939936e1..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/crypto/randomUUID.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.randomUUID() - -The **`randomUUID()`** method is used to generate a v4 [UUID](https://developer.mozilla.org/en-US/docs/Glossary/UUID) using a cryptographically secure random number generator. - -## Syntax - -```js -randomUUID() -``` - -### Parameters - -None. - -### Return value - -A string containing a randomly generated, 36 character long v4 UUID. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/globals/crypto/subtle.mdx b/documentation/versioned_docs/version-3.9.0/globals/crypto/subtle.mdx deleted file mode 100644 index c7ba95965f..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/crypto/subtle.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# Crypto.subtle - -The **`Crypto.subtle`** read-only property returns a -[`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) which can then be used to perform low-level -cryptographic operations. - -## Value - -A [`SubtleCrypto`](../SubtleCrypto/SubtleCrypto.mdx) object you can use to interact with the Web Crypto API's -low-level cryptography features. diff --git a/documentation/versioned_docs/version-3.9.0/globals/decodeURI.mdx b/documentation/versioned_docs/version-3.9.0/globals/decodeURI.mdx deleted file mode 100644 index d25a87b708..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/decodeURI.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURI - -The **`decodeURI()`** function decodes a Uniform Resource Identifier (URI) previously created by [`encodeURI()`](../globals/encodeURI.mdx) or a similar routine. - -## Syntax - -```js -decodeURI(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : A complete, encoded Uniform Resource Identifier. - -### Return value - -A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURI()` is a function property of the global object. - -The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (for 1-byte ASCII characters), 2, 3, or 4, indicates the number of bytes in the character. So by reading the first escape sequence, `decodeURI()` can determine how many more escape sequences to consume. If `decodeURI()` fails to find the expected number of sequences, or if the escape sequences don't encode a valid UTF-8 character, a [`URIError`](../globals/URIError/URIError.mdx) is thrown. - -`decodeURI()` decodes all escape sequences, but if the escape sequence encodes one of the following characters, the escape sequence is preserved in the output string (because they are part of the URI syntax): - -``` -; / ? : @ & = + $ , # -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/decodeURIComponent.mdx b/documentation/versioned_docs/version-3.9.0/globals/decodeURIComponent.mdx deleted file mode 100644 index b98bc05caf..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/decodeURIComponent.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# decodeURIComponent - -The **`decodeURIComponent()`** function decodes a Uniform Resource Identifier (URI) component previously created by [`encodeURIComponent()`](./encodeURIComponent.mdx) or by a similar routine. - - -## Syntax - -```js -decodeURIComponent(encodedURI) -``` - -### Parameters - -- `encodedURI` - - : An encoded component of a Uniform Resource Identifier. - -### Return value - -A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. - -### Exceptions - -- [`URIError`](../globals/URIError/URIError.mdx) - - : Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. - -## Description - -`decodeURIComponent()` is a function property of the global object. - -`decodeURIComponent()` uses the same decoding algorithm as described in [`decodeURI()`](./decodeURI.mdx). It decodes _all_ escape sequences, including those that are not created by [`encodeURIComponent()`](./encodeURIComponent.mdx), like `-.!~*'()`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/encodeURI.mdx b/documentation/versioned_docs/version-3.9.0/globals/encodeURI.mdx deleted file mode 100644 index f35037de1e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/encodeURI.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURI() - -The **`encodeURI()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURIComponent()`](./encodeURIComponent.mdx), this function encodes fewer characters, preserving those that are part of the URI syntax. - -## Syntax - -```js -encodeURI(uri) -``` - -### Parameters - -- `uri` - - : A string to be encoded as a URI. - -### Return value - -A new string representing the provided string encoded as a URI. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uri` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURI()` is a function property of the global object. - -The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid Unicode character, they cause `encodeURI()` to throw a [`URIError`](./URIError/URIError.mdx). - -`encodeURI()` escapes all characters **except**: - -``` -A–Z a–z 0–9 - _ . ! ~ * ' ( ) - -; / ? : @ & = + $ , # -``` - -The characters on the second line are characters that may be part of the URI syntax, and are only escaped by `encodeURIComponent()`. Both `encodeURI()` and `encodeURIComponent()` do not encode the characters `-.!~*'()`, known as "unreserved marks", which do not have a reserved purpose but are allowed in a URI "as is". (See [RFC2396](https://www.ietf.org/rfc/rfc2396.txt)) - -The `encodeURI()` function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the parts that a URI can possibly contain. Note how certain characters are used to signify special meaning: - -``` -http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor -``` diff --git a/documentation/versioned_docs/version-3.9.0/globals/encodeURIComponent.mdx b/documentation/versioned_docs/version-3.9.0/globals/encodeURIComponent.mdx deleted file mode 100644 index 5e18ce401d..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/encodeURIComponent.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# encodeURIComponent - -The **`encodeURIComponent()`** function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). Compared to [`encodeURI()`](./encodeURI.mdx), this function encodes more characters, including those that are part of the URI syntax. - -## Syntax - -```js -encodeURIComponent(uriComponent) -``` - -### Parameters - -- `uriComponent` - - : A string to be encoded as a URI component (a path, query string, fragment, etc.). Other values are [converted to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). - -### Return value - -A new string representing the provided `uriComponent` encoded as a URI component. - -### Exceptions - -- [`URIError`](./URIError/URIError.mdx) - - : Thrown if `uriComponent` contains a [lone surrogate](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_codepoints_and_grapheme_clusters). - -## Description - -`encodeURIComponent()` is a function property of the global object. - -`encodeURIComponent()` uses the same encoding algorithm as described in [`encodeURI()`](./encodeURI.mdx). It escapes all characters **except**: - -```text -A–Z a–z 0–9 - _ . ! ~ * ' ( ) -``` - -Compared to [`encodeURI()`](./encodeURI.mdx), `encodeURIComponent()` escapes a larger set of characters. Use `encodeURIComponent()` on user-entered fields from forms `POST`'d to the server — this will encode `&` symbols that may inadvertently be generated during data entry for special HTML entities or other characters that require encoding/decoding. For example, if a user writes `Jack & Jill`, without `encodeURIComponent()`, the ampersand could be interpreted on the server as the start of a new field and jeopardize the integrity of the data. - -For [`application/x-www-form-urlencoded`](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#application/x-www-form-urlencoded-encoding-algorithm), spaces are to be replaced by `+`, so one may wish to follow a `encodeURIComponent()` replacement with an additional replacement of `%20` with `+`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/escape.mdx b/documentation/versioned_docs/version-3.9.0/globals/escape.mdx deleted file mode 100644 index 4460e1a06a..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/escape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# escape() - -> **Note:** `escape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`encodeURIComponent()`](./encodeURIComponent.mdx) or [`encodeURI()`](./encodeURI.mdx) if possible. - -The **`escape()`** function computes a new string in which certain characters have been replaced by hexadecimal escape sequences. - -## Syntax - -```js -escape(str) -``` - -### Parameters - -- `str` - - : A string to be encoded. - -### Return value - -A new string in which certain characters have been escaped. - -## Description - -`escape()` is a function property of the global object. - -The `escape()` function replaces all characters with escape sequences, with the exception of ASCII word characters (A–Z, a–z, 0–9, _) and `@*_+-./`. Characters are escaped by UTF-16 code units. If the code unit's value is less than 256, it is represented by a two-digit hexadecimal number in the format `%XX`, left-padded with 0 if necessary. Otherwise, it is represented by a four-digit hexadecimal number in the format `%uXXXX`, left-padded with 0 if necessary. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The escape format is _not_ an [escape sequence](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `%XX` with `\xXX` and `%uXXXX` with `\uXXXX` to get a string containing actual string-literal escape sequences. diff --git a/documentation/versioned_docs/version-3.9.0/globals/eval.mdx b/documentation/versioned_docs/version-3.9.0/globals/eval.mdx deleted file mode 100644 index 3f243d9594..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/eval.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# eval - -> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below. - -The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script. - -## Syntax - -```js -eval(script) -``` - -### Parameters - -- `script` - - : A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. It will be parsed as a script, so [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) declarations (which can only exist in modules) are not allowed. - -### Return value - -The completion value of evaluating the given code. If the completion value is empty, [`undefined`](./undefined.mdx) is returned. If `script` is not a string primitive, `eval()` returns the argument unchanged. - -### Exceptions - -Throws any exception that occurs during evaluation of the code, including[ `SyntaxError`](./SyntaxError/SyntaxError.mdx) if `script` fails to be parsed as a script. - -## Description - -`eval()` is a function property of the global object. - -The argument of the `eval()` function is a string. It will evaluate the source string as a script body, which means both statements and expressions are allowed. It returns the completion value of the code. For expressions, it's the value the expression evaluates to. Many statements and declarations have completion values as well, but the result may be surprising (for example, the completion value of an assignment is the assigned value, but the completion value of [`let`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/let) is undefined), so it's recommended to not rely on statements' completion values. diff --git a/documentation/versioned_docs/version-3.9.0/globals/fetch.mdx b/documentation/versioned_docs/version-3.9.0/globals/fetch.mdx deleted file mode 100644 index 32581670e4..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/fetch.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# fetch() - -The global **`fetch()`** method starts the process of fetching a -resource from the network, returning a promise which is fulfilled once the response is -available. - -The promise resolves to the `Response` object -representing the response to your request. - -A `fetch()` promise only rejects when a -network error is encountered (which is usually when there's a permissions issue or -similar). A `fetch()` promise _does -not_ reject on HTTP errors (`404`, etc.). Instead, a -`then()` handler must check the `Response.ok` and/or -`Response.status` properties. - -> **Note:** The `fetch()` method's parameters are identical to -> those of the `Request()` constructor. - -## Syntax - -```js -fetch(resource) -fetch(resource, options) -``` - -### Parameters - -- `resource` - - - : This defines the resource that you wish to fetch. This can either be: - - - A string or any other object with a "toString" method. - - A `Request` object. - -- `options` _**optional**_ - - - : An object containing any custom settings that you want to apply to the request. The - possible options are: - - - `method` - - : The request method, e.g., `GET`, `POST`. - - `headers` - - : Any headers you want to add to your request, contained within a - `Headers` object or an object literal with `String` - values. - - `body` - - : Any body that you want to add to your request: this can be an `ArrayBuffer`, a `TypedArray`, a `DataView`, a `URLSearchParams`, string object or literal, or a `ReadableStream` object. - - `backend` _**Fastly-specific**_ - - *Fastly-specific* - - `cacheOverride` _**Fastly-specific**_ - - `cacheKey` _**Fastly-specific**_ - - `fastly` _**Fastly-specific**_ - - `decompressGzip`_: boolean_ _**optional**_ - - Whether to automatically gzip decompress the Response or not. - -### Return value - -A `Promise` that resolves to a `Response` object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/globalThis.mdx b/documentation/versioned_docs/version-3.9.0/globals/globalThis.mdx deleted file mode 100644 index 005cc42eb7..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/globalThis.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# globalThis - -The global **`globalThis`** property contains the [global `this`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context) value, which is usually akin to the [global object](https://developer.mozilla.org/docs/Glossary/Global_object). - -## Value - -The global `this` object. - -> **Note:** The `globalThis` property is configurable and writable so that code authors can hide it when executing untrusted code and prevent exposing the global object. - -## Description - -The `globalThis` property provides a standard way of accessing the global `this` value (and hence the global object itself) across environments. - diff --git a/documentation/versioned_docs/version-3.9.0/globals/isFinite.mdx b/documentation/versioned_docs/version-3.9.0/globals/isFinite.mdx deleted file mode 100644 index 03b6c831bc..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/isFinite.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isFinite - -The global **`isFinite()`** function determines whether the -passed value is a finite number. If needed, the parameter is first converted to a -number. - -## Syntax - -```js -isFinite(testValue) -``` - -### Parameters - -- `testValue` - - : The value to be tested for finiteness. - -### Return value - -**`false`** if the argument is (or will be coerced to) positive -or negative [`Infinity`](./Infinity.mdx) or [`NaN`](./NaN.mdx) or [`undefined`](./undefined.mdx); -otherwise, **`true`**. - -## Description - -`isFinite` is a function property of the global object. - -You can use this function to determine whether a number is a finite number. The -`isFinite` function examines the number in its argument. If the argument is -`NaN`, positive infinity, or negative infinity, this method returns -`false`; otherwise, it returns `true`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/isNaN.mdx b/documentation/versioned_docs/version-3.9.0/globals/isNaN.mdx deleted file mode 100644 index cae295d082..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/isNaN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# isNaN() - -The **`isNaN()`** function determines whether a value is [`NaN`](./NaN.mdx) when converted to a number. Because coercion inside the `isNaN()` function can be [surprising](#description), you may alternatively want to use [`Number.isNaN()`](./Number/isNaN.mdx). - -## Syntax - -```js -isNaN(value) -``` - -### Parameters - -- `value` - - : The value to be tested. - -### Return value - -`true` if the given value is [`NaN`](./NaN.mdx) after being [converted to a number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion); otherwise, `false`. - -## Description - -`isNaN()` is a function property of the global object. - -For number values, `isNaN()` tests if the number is the value [`NaN`](./NaN.mdx). When the argument to the `isNaN()` function is not of type [Number](https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type), the value is first coerced to a number, and the resulting value is then compared against [`NaN`](./NaN.mdx). - -This behavior of `isNaN()` for non-numeric arguments can be confusing! For example, an empty string is coerced to 0, while a boolean is coerced to 0 or 1; both values are intuitively "not numbers", but they don't evaluate to `NaN`, so `isNaN()` returns `false`. Therefore, `isNaN()` answers neither the question "is the input the floating point [`NaN`](./NaN.mdx) value" nor the question "is the input not a number". - -[`Number.isNaN()`](./Number/isNaN.mdx) is a more reliable way to test whether a value is the number value `NaN` or not. Alternatively, the expression `x !== x` can be used, and neither of the solutions is subject to the false positives that make the global `isNaN()` unreliable. To test if a value is a number, use [`typeof x === "number"`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/typeof). - -The `isNaN()` function answers the question "is the input functionally equivalent to [`NaN`](./NaN.mdx) when used in a number context". If `isNaN(x)` returns `false`, you can use `x` in an arithmetic expression as if it's a valid number that's not `NaN`. If `isNaN(x)` returns `true`, `x` will get coerced to `NaN` and make most arithmetic expressions return `NaN` (because `NaN` propagates). You can use this, for example, to test whether an argument to a function is arithmetically processable (usable "like" a number), and handle values that are not number-like by throwing an error, providing a default value, etc. This way, you can have a function that makes use of the full versatility JavaScript provides by implicitly converting values depending on context. diff --git a/documentation/versioned_docs/version-3.9.0/globals/location.mdx b/documentation/versioned_docs/version-3.9.0/globals/location.mdx deleted file mode 100644 index 1c549ffac4..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/location.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# location - -The **`location`** read-only property returns a -[`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object with information about the current location of the -document. - -See [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) for all available properties. - -## Value - -A [`Location`](../globals/WorkerLocation/WorkerLocation.mdx) object. diff --git a/documentation/versioned_docs/version-3.9.0/globals/parseFloat.mdx b/documentation/versioned_docs/version-3.9.0/globals/parseFloat.mdx deleted file mode 100644 index 0cf52287e5..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/parseFloat.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseFloat() - -The **`parseFloat()`** function parses a string argument and returns a floating point number. - -## Syntax - -```js -parseFloat(string) -``` - -### Parameters - -- `string` - - : The value to parse, [coerced to a string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion). Leading whitespace in this argument is ignored. - -### Return value - -A floating point number parsed from the given `string`, or [`NaN`](./NaN.mdx) when the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. [`parseInt()`](./parseInt.mdx) and `parseFloat()` only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseFloat` function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or `NaN`. The number syntax it accepts can be summarized as: - -- The characters accepted by `parseFloat()` are plus sign (`+`), minus sign (`-` U+002D HYPHEN-MINUS), decimal digits (`0` – `9`), decimal point (`.`), exponent indicator (`e` or `E`), and the `"Infinity"` literal. -- The `+`/`-` signs can only appear strictly at the beginning of the string, or immediately following the `e`/`E` character. The decimal point can only appear once, and only before the `e`/`E` character. The `e`/`E` character can only appear once, and only if there is at least one digit before it. -- Leading spaces in the argument are trimmed and ignored. -- `parseFloat()` can also parse and return [`Infinity`](./Infinity.mdx) or `-Infinity` if the string starts with `"Infinity"` or `"-Infinity"` preceded by none or more white spaces. -- `parseFloat()` picks the longest substring starting from the beginning that generates a valid number literal. If it encounters an invalid character, it returns the number represented up to that point, ignoring the invalid character and all characters following it. -- If the argument's first character can't start a legal number literal per the syntax above, `parseFloat` returns [`NaN`](./NaN.mdx). - -Syntax-wise, `parseFloat()` parses a subset of the syntax that the [`Number()`](./Number/Number.mdx) function accepts. Namely, `parseFloat()` does not support non-decimal literals with `0x`, `0b`, or `0o` prefixes but supports everything else. However, `parseFloat()` is more lenient than `Number()` because it ignores trailing invalid characters, which would cause `Number()` to return `NaN`. - -Similar to number literals and `Number()`, the number returned from `parseFloat()` may not be exactly equal to the number represented by the string, due to floating point range and inaccuracy. For numbers outside the `-1.7976931348623158e+308` – `1.7976931348623158e+308` range (see `Number.MAX_VALUE`), `-Infinity` or `Infinity` is returned. diff --git a/documentation/versioned_docs/version-3.9.0/globals/parseInt.mdx b/documentation/versioned_docs/version-3.9.0/globals/parseInt.mdx deleted file mode 100644 index c07438c72b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/parseInt.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# parseInt - -The **`parseInt()`** function parses a string argument and returns an integer of the specified [radix](https://en.wikipedia.org/wiki/Radix) (the base in mathematical numeral systems). - - - -## Syntax - -```js -parseInt(string) -parseInt(string, radix) -``` - -### Parameters - -- `string` - - : A string starting with an integer. Leading whitespace in this argument is ignored. -- `radix` _**optional**_ - - - : An integer between `2` and `36` that represents the _radix_ (the base in mathematical numeral systems) of the `string`. It is converted to a [32-bit integer](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number#fixed-width_number_conversion); if it's outside the range of \[2, 36] after conversion, the function will always return `NaN`. If `0` or not provided, the radix will be inferred based on `string`'s value. Be careful — this does NOT always default to `10`! The [description below](#description) explains in more detail what happens when `radix` is not provided. - -### Return value - -An integer parsed from the given `string`, or [`NaN`](./NaN.mdx) when - -- the `radix` as a 32-bit integer is smaller than `2` or bigger than `36`, or -- the first non-whitespace character cannot be converted to a number. - -> **Note:** JavaScript does not have the distinction of "floating point numbers" and "integers" on the language level. `parseInt()` and [`parseFloat()`](./parseFloat.mdx) only differ in their parsing behavior, but not necessarily their return values. For example, `parseInt("42")` and `parseFloat("42")` would return the same value: a `Number` 42. - -## Description - -The `parseInt` function converts its first argument to a string, parses that string, then returns an integer or `NaN`. - -If not `NaN`, the return value will be the integer that is the first argument taken as a number in the specified `radix`. (For example, a `radix` of `10` converts from a decimal number, `8` converts from octal, `16` from hexadecimal, and so on.) - -The `radix` argument is converted to a number. If it's unprovided, or if the value becomes 0, `NaN` or `Infinity` (`undefined` is coerced to `NaN`), JavaScript assumes the following: - -1. If the input `string`, with leading whitespace and possible `+`/`-` signs removed, begins with `0x` or `0X` (a zero, followed by lowercase or uppercase X), `radix` is assumed to be `16` and the rest of the string is parsed as a hexadecimal number. -2. If the input `string` begins with any other value, the radix is `10` (decimal). - -> **Note:** Other prefixes like `0b`, which are valid in [number literals](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Lexical_grammar#binary), are treated as normal digits by `parseInt()`. `parseInt()` does _not_ treat strings beginning with a `0` character as octal values either. The only prefix that `parseInt()` recognizes is `0x` or `0X` for hexadecimal values — everything else is parsed as a decimal value if `radix` is missing. - -If the radix is `16`, `parseInt()` allows the string to be optionally prefixed by `0x` or `0X` after the optional sign character (`+`/`-`). - -If the radix value (coerced if necessary) is not in range \[2, 36] (inclusive) `parseInt` returns `NaN`. - -For radices above `10`, letters of the English alphabet indicate numerals greater than `9`. For example, for hexadecimal numbers (base `16`), `A` through `F` are used. The letters are case-insensitive. - -`parseInt` understands exactly two signs: `+` for positive, and `-` for negative. It is done as an initial step in the parsing after whitespace is removed. If no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. - -If `parseInt` encounters a character that is not a numeral in the specified `radix`, it ignores it and all succeeding characters and returns the integer value parsed up to that point. For example, although `1e3` technically encodes an integer (and will be correctly parsed to the integer `1000` by [`parseFloat()`](./parseFloat.mdx), `parseInt("1e3", 10)` returns `1`, because `e` is not a valid numeral in base 10. Because `.` is not a numeral either, the return value will always be an integer. - -If the first character cannot be converted to a number with the radix in use, `parseInt` returns `NaN`. Leading whitespace is allowed. - -For arithmetic purposes, the `NaN` value is not a number in any radix. You can call the [`Number.isNaN`](./Number/isNaN.mdx) function to determine if the result of `parseInt` is `NaN`. If `NaN` is passed on to arithmetic operations, the operation result will also be `NaN`. - -Because large numbers use the `e` character in their string representation (e.g. `6.022e23` for 6.022 × 1023), using `parseInt` to truncate numbers will produce unexpected results when used on very large or very small numbers. `parseInt` should _not_ be used as a substitute for [`Math.trunc()`](./Math/trunc.mdx). - -To convert a number to its string literal in a particular radix, use [`thatNumber.toString(radix)`](./Number/prototype/toString.mdx). - -Because `parseInt()` returns a number, it may suffer from loss of precision if the integer represented by the string is [outside the safe range](./Number/isSafeInteger.mdx). The [`BigInt`](./BigInt/BigInt.mdx) function supports parsing integers of arbitrary length accurately, by returning a `BigInt`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/performance/now.mdx b/documentation/versioned_docs/version-3.9.0/globals/performance/now.mdx deleted file mode 100644 index da8f617cb9..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/performance/now.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.now() - -The **`performance.now()`** method returns a high resolution timestamp in milliseconds. -It represents the time elapsed since [`performance.timeOrigin`](./timeOrigin.mdx) (the time when the worker was instantiated). - -## Syntax - -```js -now() -``` - -### Parameters - -None. - -### Return value - -Returns a number which represents the time since worker instantation measured in milliseconds. diff --git a/documentation/versioned_docs/version-3.9.0/globals/performance/timeOrigin.mdx b/documentation/versioned_docs/version-3.9.0/globals/performance/timeOrigin.mdx deleted file mode 100644 index 772a527822..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/performance/timeOrigin.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# performance.timeOrigin - -The **`timeOrigin`** read-only property of the Performance interface returns the high resolution timestamp that is used as the baseline for performance-related timestamps. - -This value represents the time when the worker was instantiated. - -### Value - -Returns a number which represents the time when the worker was instantation. \ No newline at end of file diff --git a/documentation/versioned_docs/version-3.9.0/globals/setInterval.mdx b/documentation/versioned_docs/version-3.9.0/globals/setInterval.mdx deleted file mode 100644 index 8133748deb..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/setInterval.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setInterval() - -The **`setInterval()`** method, repeatedly -calls a function or executes a code snippet, with a fixed time delay between each -call. - -This method returns an interval ID which uniquely identifies the interval, so you -can remove it later by calling `clearInterval()`. - -## Syntax - -```js -setInterval(code) -setInterval(code, delay) - -setInterval(func) -setInterval(func, delay) -setInterval(func, delay, arg0) -setInterval(func, delay, arg0, arg1) -setInterval(func, delay, arg0, arg1, /* … ,*/ argN) -``` - -### Parameters - -- `func` - - : A `function` to be executed every `delay` milliseconds. The first execution happens after `delay` milliseconds. -- `code` - - : An optional syntax allows you to include a string instead of a function, which is - compiled and executed every `delay` milliseconds. This syntax is _not - recommended_ for the same reasons that make using `eval() a - security risk. -- `delay` _**optional**_ - - : The time, in milliseconds (thousandths of a second), the timer should delay in - between executions of the specified function or code. Defaults to 0 if not specified. - below for details on the permitted range of `delay` values. -- `arg0, …, argN` _**optional**_ - - : Additional arguments which are passed through to the function specified by - _func_ once the timer expires. - -### Return value - -The returned `intervalID` is a numeric, non-zero value which identifies the -timer created by the call to `setInterval()`; this value can be passed to -`clearInterval()` to cancel the interval. - -It may be helpful to be aware that `setInterval()` and -`setTimeout()` share the same pool -of IDs, and that `clearInterval()` and -`clearTimeout()` can technically -be used interchangeably. For clarity, however, you should try to always match them to -avoid confusion when maintaining your code. - -> **Note:** The `delay` argument is converted to a -> signed 32-bit integer. This effectively limits `delay` to 2147483647 ms, -> since it's specified as a signed integer in the IDL. diff --git a/documentation/versioned_docs/version-3.9.0/globals/setTimeout.mdx b/documentation/versioned_docs/version-3.9.0/globals/setTimeout.mdx deleted file mode 100644 index 2503267d3e..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/setTimeout.mdx +++ /dev/null @@ -1,61 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# setTimeout() - -The global **`setTimeout()`** method sets a timer which executes a function or specified -piece of code once the timer expires. - -## Syntax - -```js -setTimeout(code) -setTimeout(code, delay) - -setTimeout(functionRef) -setTimeout(functionRef, delay) -setTimeout(functionRef, delay, param1) -setTimeout(functionRef, delay, param1, param2) -setTimeout(functionRef, delay, param1, param2, /* … ,*/ paramN) -``` - -### Parameters - -- `functionRef` - - : A `function` to be executed after the timer expires. -- `code` - - : An alternative syntax that allows you to include a string instead of a function, - which is compiled and executed when the timer expires. This syntax is **not - recommended** for the same reasons that make using - `eval()` a security risk. -- `delay` _**optional**_ - - - : The time, in milliseconds that the timer should wait before - the specified function or code is executed. If this parameter is omitted, a value of 0 - is used, meaning execute "immediately", or more accurately, the next event cycle. - -- `param1`, …, `paramN` _**optional**_ - - - : Additional arguments which are passed through to the function specified by - `functionRef`. - -### Return value - -The returned `timeoutID` is a positive integer value which -identifies the timer created by the call to `setTimeout()`. This value can be -passed to `clearTimeout()` to -cancel the timeout. - -It is guaranteed that a `timeoutID` value will never be reused by a subsequent call to -`setTimeout()` or `setInterval()` on the same object (a window or -a worker). However, different objects use separate pools of IDs. - -## Description - -Timeouts are cancelled using `clearTimeout()`. - -To call a function repeatedly (e.g., every _N_ milliseconds), consider using -`setInterval()`. diff --git a/documentation/versioned_docs/version-3.9.0/globals/structuredClone.mdx b/documentation/versioned_docs/version-3.9.0/globals/structuredClone.mdx deleted file mode 100644 index 8b0ff80673..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/structuredClone.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# structuredClone() - -The global **`structuredClone()`** method creates a deep clone of a given value. - -## Syntax - -```js -structuredClone(value) -``` - -### Parameters - -- `value` - - : The object to be cloned. - -### Return value - -The returned value is a deep copy of the original `value`. - -### Exceptions - -- `DataCloneError` - - : Thrown if any part of the input value is not serializable. - -## Description - -This function can be used to deep copy JavaScript values. diff --git a/documentation/versioned_docs/version-3.9.0/globals/undefined.mdx b/documentation/versioned_docs/version-3.9.0/globals/undefined.mdx deleted file mode 100644 index 3b2f4b750b..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/undefined.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# undefined - -The global **`undefined`** property represents the primitive -value `undefined`. It is one of JavaScript's "primitive types". - -## Value - -The primitive value `undefined`. - -## Description - -`undefined` is a property of the _global object_. That is, it is a variable in global scope. - -`undefined` is a non-configurable, non-writable property. - -A variable that has not been assigned a value is of type `undefined`. A -method or statement also returns `undefined` if the variable that is being -evaluated does not have an assigned value. A function returns `undefined` if -a value was not explicitly returned. diff --git a/documentation/versioned_docs/version-3.9.0/globals/unescape.mdx b/documentation/versioned_docs/version-3.9.0/globals/unescape.mdx deleted file mode 100644 index ccb47def80..0000000000 --- a/documentation/versioned_docs/version-3.9.0/globals/unescape.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- -# unescape() - -> **Note:** `unescape()` is a non-standard function implemented by browsers and was only standardized for cross-engine compatibility. It is not required to be implemented by all JavaScript engines and may not work everywhere. Use [`decodeURIComponent()`](./decodeURIComponent.mdx) or [`decodeURI()`](./decodeURI.mdx) if possible. - -The **`unescape()`** function computes a new string in which hexadecimal escape sequences are replaced with the characters that they represent. The escape sequences might be introduced by a function like [`escape()`](./escape.mdx). - -## Syntax - -```js -unescape(str) -``` - -### Parameters - -- `str` - - : A string to be decoded. - -### Return value - -A new string in which certain characters have been unescaped. - -## Description - -`unescape()` is a function property of the global object. - -The `unescape()` function replaces any escape sequence with the character that it represents. Specifically, it replaces any escape sequence of the form `%XX` or `%uXXXX` (where `X` represents one hexadecimal digit) with the character that has the hexadecimal value `XX`/`XXXX`. If the escape sequence is not a valid escape sequence (for example, if `%` is followed by one or no hex digit), it is left as-is. - -> **Note:** This function was used mostly for URL encoding and is partly based on the escape format in rfc(1738). The `unescape()` function does _not_ evaluate [escape sequences](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences) in string literals. You can replace `\xXX` with `%XX` and `\uXXXX` with `%uXXXX` to get a string that can be handled by `unescape()`. diff --git a/documentation/versioned_docs/version-3.9.0/index.mdx b/documentation/versioned_docs/version-3.9.0/index.mdx deleted file mode 100644 index 1670189828..0000000000 --- a/documentation/versioned_docs/version-3.9.0/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -import {Fiddle} from '@site/src/components/fiddle'; - -# JavaScript for Fastly Compute - -This site is the full SDK reference for [`@fastly/js-compute`](https://www.npmjs.com/package/%40fastly/js-compute), the module that provides the interface between your JavaScript code and the [Fastly Compute](https://www.fastly.com) platform. - -If you haven't used Fastly Compute before, start by [setting up your first Fastly Compute program](https://developer.fastly.com/learning/compute/) over on **developer.fastly.com** so that you have a working development environment. - -To learn more about the fundamentals of using JavaScript with Fastly Compute, see our [using JavaScript](https://developer.fastly.com/learning/compute/javascript/) guide. - -## Understanding the JavaScript SDK - -Incoming HTTP requests to [domains that are attached to your Fastly service](https://developer.fastly.com/learning/concepts/) will start an instance of your application and invoke a `fetch` event, which can be bound using the `addEventListener` function: - -```js -addEventListener("fetch", event => event.respondWith(handleRequest(event)) ); - -async function handleRequest(event) { - const req = event.request; - - return fetch(req, { - backend: "example_backend" - }); -} -``` - -Fastly specific features are available as named imports from `fastly:` prefixed modules, all of which are documented in this site. For example, the [env](https://js-compute-reference-docs.edgecompute.app/docs/fastly:env/env) function provides access to [environment variables](https://developer.fastly.com/reference/compute/ecp-env/) and can be imported into your application like this: - -```js -import { env } from "fastly:env" -``` - -JavaScript code compiled for Fastly Compute has access to a global environment with most of the globals you would expect in an ECMAScript runtime, like [`Date`](https://js-compute-reference-docs.edgecompute.app/docs/globals/Date/) and [`console`](https://js-compute-reference-docs.edgecompute.app/docs/globals/console/log). - -## Trying things out - -[Fastly fiddle](https://fiddle.fastly.dev) is an online web-based playground where you can run Fastly code. You'll see fiddles included in many pages of our [developer hub](https://developer.fastly.com) and this SDK reference. These interactive examples can be executed right on the page by clicking the **RUN** tab: - - -async function app(event) { - const request = event.request; - return new Response("You made a request to " + request.url) -} -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); -` - }, - "requests": [ - { - "enableCluster": true, - "enableShield": false, - "enableWAF": false, - "method": "GET", - "path": "/status=200", - "useFreshCache": false, - "followRedirects": false, - "tests": "", - "delay": 0 - } - ], - "srcVersion": 1 -}}> - -```js -/// - -async function app(event) { - const request = event.request; - return new Response(`You made a request to ${request.url}`) -} - -addEventListener("fetch", event => { - event.respondWith(app(event)); -}); - -``` - - - -Check out [`fiddle.fastly.dev`](https://fiddle.fastly.dev) to create your own. diff --git a/documentation/versioned_docs/version-3.9.0/migration-guide/index.mdx b/documentation/versioned_docs/version-3.9.0/migration-guide/index.mdx deleted file mode 100644 index 543d0432cd..0000000000 --- a/documentation/versioned_docs/version-3.9.0/migration-guide/index.mdx +++ /dev/null @@ -1,98 +0,0 @@ ---- -sidebar_position: 1 -hide_title: false -hide_table_of_contents: false -pagination_next: null -pagination_prev: null ---- - -# `Migrating from v2 to v3` - -## SimpleCache.delete renamed to SimpleCache.purge and requires purge options to be supplied as the second parameter - -We are renaming because "purge" is already a well-known and documented concept for removing content from Fastly's cache. - -The new addition of a second argument allows the caller to decide what scope to purge the content from, currently they can choose to purge from all of Fastly ("global") or from the POP that contains the currently executing instance ("pop"). We do not provide a default option right now, in the future we may provide a default option, if we discover a common pattern is being used. - -Here is an example of migrating an application using `SimpleCache.delete` to `SimpleCache.purge` with the same purging behaviour: -```diff -/// - -import { SimpleCache } from 'fastly:cache'; - -addEventListener('fetch', event => event.respondWith(app(event))); - -async function app(event) { - const url = new URL(event.request); - const path = url.pathname; - if (url.searchParams.has('delete')) { -- SimpleCache.delete(path); -+ SimpleCache.purge(path, { scope: "global" }); - return new Response(page, { status: 204 }); - } - - let page = SimpleCache.getOrSet(path, async () => { - return { - value: await render(path), - // Store the page in the cache for 1 minute. - ttl: 60 - } - }); - return new Response(page, { - headers: { - 'content-type': 'text/plain;charset=UTF-8' - } - }); -} - -async function render(path) { - // expensive/slow function which constructs and returns the contents for a given path - await new Promise(resolve => setTimeout(resolve, 10_000)); - return path; -} - - -``` - - -# `Migrating from v1 to v2` - -## ObjectStore renamed to KVStore - -We have renamed the `ObjectStore` class to `KVStore`, and the module name from `fastly:object-store` to `fastly:kv-store`. - -You will need to update your code to use the new class name and module name. - -Below is the change that would need to be made for the imported module name: -```diff -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; -``` - -And this is the change that would need to be made for constructing an instance of the class: -```diff -- const store = new ObjectStore('my-store'); -+ const store = new KVStore('my-store'); -``` - - -Here is a full example of migrating an application from ObjectStore to KVStore: -```diff -/// - -- import { ObjectStore } from 'fastly:object-store'; -+ import { KVStore } from 'fastly:kv-store'; - -async function app(event) { -- const files = new ObjectStore('files'); -+ const files = new KVStore('files'); - - await files.put('hello', 'world') - - const entry = await files.get('hello') - - return new Response(await entry.text()) -} - -addEventListener("fetch", (event) => event.respondWith(app(event))) -``` \ No newline at end of file diff --git a/documentation/versioned_sidebars/version-1.1.0-sidebars.json b/documentation/versioned_sidebars/version-1.1.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-1.1.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-1.10.0-sidebars.json b/documentation/versioned_sidebars/version-1.10.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-1.10.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-1.11.0-sidebars.json b/documentation/versioned_sidebars/version-1.11.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-1.11.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-1.12.0-sidebars.json b/documentation/versioned_sidebars/version-1.12.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-1.12.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-1.2.0-sidebars.json b/documentation/versioned_sidebars/version-1.2.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-1.2.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-1.3.0-sidebars.json b/documentation/versioned_sidebars/version-1.3.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-1.3.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-1.4.0-sidebars.json b/documentation/versioned_sidebars/version-1.4.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-1.4.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-1.5.0-sidebars.json b/documentation/versioned_sidebars/version-1.5.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-1.5.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-1.6.0-sidebars.json b/documentation/versioned_sidebars/version-1.6.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-1.6.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-1.7.0-sidebars.json b/documentation/versioned_sidebars/version-1.7.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-1.7.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-1.8.0-sidebars.json b/documentation/versioned_sidebars/version-1.8.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-1.8.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-1.9.0-sidebars.json b/documentation/versioned_sidebars/version-1.9.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-1.9.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-2.0.0-sidebars.json b/documentation/versioned_sidebars/version-2.0.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-2.0.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-2.1.0-sidebars.json b/documentation/versioned_sidebars/version-2.1.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-2.1.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-2.2.0-sidebars.json b/documentation/versioned_sidebars/version-2.2.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-2.2.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-2.3.0-sidebars.json b/documentation/versioned_sidebars/version-2.3.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-2.3.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-2.4.0-sidebars.json b/documentation/versioned_sidebars/version-2.4.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-2.4.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-3.0.0-sidebars.json b/documentation/versioned_sidebars/version-3.0.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-3.0.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-3.1.0-sidebars.json b/documentation/versioned_sidebars/version-3.1.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-3.1.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-1.0.0-sidebars.json b/documentation/versioned_sidebars/version-3.10.0-sidebars.json similarity index 100% rename from documentation/versioned_sidebars/version-1.0.0-sidebars.json rename to documentation/versioned_sidebars/version-3.10.0-sidebars.json diff --git a/documentation/versioned_sidebars/version-3.2.0-sidebars.json b/documentation/versioned_sidebars/version-3.2.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-3.2.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-3.3.0-sidebars.json b/documentation/versioned_sidebars/version-3.3.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-3.3.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-3.3.2-sidebars.json b/documentation/versioned_sidebars/version-3.3.2-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-3.3.2-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-3.4.0-sidebars.json b/documentation/versioned_sidebars/version-3.4.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-3.4.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-3.5.0-sidebars.json b/documentation/versioned_sidebars/version-3.5.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-3.5.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-3.6.0-sidebars.json b/documentation/versioned_sidebars/version-3.6.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-3.6.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-3.7.0-sidebars.json b/documentation/versioned_sidebars/version-3.7.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-3.7.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-3.8.0-sidebars.json b/documentation/versioned_sidebars/version-3.8.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-3.8.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versioned_sidebars/version-3.9.0-sidebars.json b/documentation/versioned_sidebars/version-3.9.0-sidebars.json deleted file mode 100644 index cff0c94e17..0000000000 --- a/documentation/versioned_sidebars/version-3.9.0-sidebars.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "defaultSidebar": [ - { - "type": "autogenerated", - "dirName": "." - } - ] -} diff --git a/documentation/versions.json b/documentation/versions.json index b9d12b0a4f..19c1bdf06c 100644 --- a/documentation/versions.json +++ b/documentation/versions.json @@ -1,33 +1,5 @@ [ - "3.9.0", - "3.8.0", - "3.7.0", - "3.6.0", - "3.5.0", - "3.4.0", - "3.3.2", - "3.3.0", - "3.2.0", - "3.1.0", - "3.0.0", + "3.10.0", "2.5.0", - "2.4.0", - "2.3.0", - "2.2.0", - "2.1.0", - "2.0.0", - "1.13.0", - "1.12.0", - "1.11.0", - "1.10.0", - "1.9.0", - "1.8.0", - "1.7.0", - "1.6.0", - "1.5.0", - "1.4.0", - "1.3.0", - "1.2.0", - "1.1.0", - "1.0.0" + "1.13.0" ] diff --git a/package.json b/package.json index e9299a5324..dd9ab7e893 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fastly/js-compute", - "version": "3.9.1", + "version": "3.10.0", "engines": { "node": "16 - 20", "npm": "^8 || ^9" diff --git a/types/device.d.ts b/types/device.d.ts index a6e4ee10b6..0bbe174582 100644 --- a/types/device.d.ts +++ b/types/device.d.ts @@ -1,17 +1,71 @@ declare module "fastly:device" { class Device { + /** + * Look up the data associated with a particular User-Agent string. + * If there is data associated with the User-Agent, a `Device` instance is returned. + * Otherwise, `null` is returned. + * @param useragent The User-Agent string to look up + */ static lookup(useragent: string): Device | null; + /** + * The name of the device. + * If no name is known, the value will be `null`. + */ get name(): string | null; + /** + * The brand of the device, possibly different from the manufacturer of that device. + * If no brand is known, the value will be `null`. + */ get brand(): string | null; + /** + * The model of the device. + * If no model is known, the value will be `null`. + */ get model(): string | null; + /** + * A string representation of the device's primary platform hardware. + * The most commonly used device types are also identified via boolean variables. + * Because a device may have multiple device types and this variable only has the primary type, + * we recommend using the boolean variables for logic and using this string representation for logging. + * + * If primary platform hardware is not known, the value will be `null`. + */ get hardwareType(): string | null; + /** + * Either a boolean stating if the device is a desktop web browser, or `null` if the this is not known. + */ get isDesktop(): boolean | null; + /** + * Either a boolean stating if the device is a video game console, or `null` if the this is not known. + */ get isGameConsole(): boolean | null; + /** + * Either a boolean stating if the device is a media player (like Blu-ray players, iPod devices, and smart speakers such as Amazon Echo), or `null` if the this is not known. + */ get isMediaPlayer(): boolean | null; + /** + * Either a boolean stating if the device is a mobile phone, or `null` if the this is not known. + */ get isMobile(): boolean | null; + /** + * Either a boolean stating if the device is a smart TV, or `null` if the this is not known. + */ get isSmartTV(): boolean | null; + /** + * Either a boolean stating if the device is a tablet (like an iPad), or `null` if the this is not known. + */ get isTablet(): boolean | null; + /** + * Either a boolean stating if the device's screen is touch sensitive, or `null` if the this is not known. + */ get isTouchscreen(): boolean | null; + + /** + * The `toJSON()` method of the Device interface is a serializer; it returns a JSON representation of the Device object. + * + * To get a JSON string, you can use `JSON.stringify(device)` directly; it will call `toJSON()` automatically. + */ + toJSON(): Object } }